cm_client.DataContextsResourceApi

All URIs are relative to https://localhost/api/v44

Method HTTP request Description
create_data_context POST /dataContexts Create a datacontext.
delete_data_context DELETE /dataContexts/{dataContextName} Delete a datacontext.
read_data_context GET /dataContexts/{dataContextName} Reads information about a datacontext.
read_data_contexts GET /dataContexts Get all the datacontexts.

create_data_context

ApiDataContext create_data_context(body=body)

Create a datacontext.

Create a datacontext. Following are are required fields of ApiDataContext: name, displayName, services.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.DataContextsResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiDataContext() # ApiDataContext | DataContext to be created. (optional)

try:
    # Create a datacontext.
    api_response = api_instance.create_data_context(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DataContextsResourceApi->create_data_context: %s\n" % e)

Parameters

Name Type Description Notes
body ApiDataContext DataContext to be created. [optional]

Return type

ApiDataContext

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_data_context

ApiDataContext delete_data_context(data_context_name)

Delete a datacontext.

Delete a datacontext.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.DataContextsResourceApi(cm_client.ApiClient(configuration))
data_context_name = 'data_context_name_example' # str | Name of the datacontext.

try:
    # Delete a datacontext.
    api_response = api_instance.delete_data_context(data_context_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DataContextsResourceApi->delete_data_context: %s\n" % e)

Parameters

Name Type Description Notes
data_context_name str Name of the datacontext.

Return type

ApiDataContext

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

read_data_context

ApiDataContext read_data_context(data_context_name)

Reads information about a datacontext.

Reads information about a datacontext.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.DataContextsResourceApi(cm_client.ApiClient(configuration))
data_context_name = 'data_context_name_example' # str | Name of the datacontext.

try:
    # Reads information about a datacontext.
    api_response = api_instance.read_data_context(data_context_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DataContextsResourceApi->read_data_context: %s\n" % e)

Parameters

Name Type Description Notes
data_context_name str Name of the datacontext.

Return type

ApiDataContext

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

read_data_contexts

ApiDataContextList read_data_contexts()

Get all the datacontexts.

Get all the datacontexts.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.DataContextsResourceApi(cm_client.ApiClient(configuration))

try:
    # Get all the datacontexts.
    api_response = api_instance.read_data_contexts()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DataContextsResourceApi->read_data_contexts: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiDataContextList

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]