do_cosmos_op(object,...)## S3 method for class 'cosmos_endpoint'do_cosmos_op(object,...)## S3 method for class 'cosmos_database'do_cosmos_op(object, path ="", resource_type ="dbs", resource_link ="",...)## S3 method for class 'cosmos_container'do_cosmos_op( object, path ="", resource_type ="colls", resource_link ="",...)## S3 method for class 'cosmos_document'do_cosmos_op( object, path ="", resource_type ="docs", resource_link ="", headers = list(),...)
Arguments
object: A Cosmos DB endpoint, database, container or document object.
...: Arguments passed to lower-level functions.
path: The (partial) URL path for the operation.
resource_type: The type of resource. For most purposes, the default value should suffice.
resource_link: The resource link for authorization. For most purposes, the default value should suffice.
headers: Any optional HTTP headers to include in the API call.
Returns
The result of call_cosmos_endpoint: either a httr response object, or a list of such objects. Call process_cosmos_response to extract the result of the call.
Details
do_cosmos_op provides a higher-level interface to the Cosmos DB REST API than call_cosmos_endpoint. In particular, it sets the resource_type and resource_link arguments to sensible defaults, and fills in the beginning of the URL path for the REST call.