cm_client.SnapshotsResourceApi

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

Method HTTP request Description
adhoc_snapshot POST /clusters/{clusterName}/services/{serviceName}/snapshots Creates one or more snapshot policies.
create_policies POST /clusters/{clusterName}/services/{serviceName}/snapshots/policies Creates one or more snapshot policies.
delete_policy DELETE /clusters/{clusterName}/services/{serviceName}/snapshots/policies/{policyName} Deletes an existing snapshot policy.
list_h_base_snapshots_command POST /clusters/{clusterName}/services/{serviceName}/snapshots/listHBaseSnapshotsCommand Starts a command that lists the available HBase snapshots from S3 or local HBase service.
read_history GET /clusters/{clusterName}/services/{serviceName}/snapshots/policies/{policyName}/history Returns a list of commands triggered by a snapshot policy.
read_policies GET /clusters/{clusterName}/services/{serviceName}/snapshots/policies Returns information for all snapshot policies.
read_policy GET /clusters/{clusterName}/services/{serviceName}/snapshots/policies/{policyName} Returns information for a specific snapshot policy.
update_policy PUT /clusters/{clusterName}/services/{serviceName}/snapshots/policies/{policyName} Updates an existing snapshot policy.

adhoc_snapshot

ApiCommand adhoc_snapshot(cluster_name, service_name, body=body)

Creates one or more snapshot policies.

Creates one or more snapshot policies.

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.SnapshotsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | 
body = cm_client.ApiAdhocSnapshot() # ApiAdhocSnapshot |  (optional)

try:
    # Creates one or more snapshot policies.
    api_response = api_instance.adhoc_snapshot(cluster_name, service_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SnapshotsResourceApi->adhoc_snapshot: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str
body ApiAdhocSnapshot [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

create_policies

ApiSnapshotPolicyList create_policies(cluster_name, service_name, body=body)

Creates one or more snapshot policies.

Creates one or more snapshot policies.

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.SnapshotsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | 
body = cm_client.ApiSnapshotPolicyList() # ApiSnapshotPolicyList | List of the snapshot policies to create. (optional)

try:
    # Creates one or more snapshot policies.
    api_response = api_instance.create_policies(cluster_name, service_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SnapshotsResourceApi->create_policies: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str
body ApiSnapshotPolicyList List of the snapshot policies to create. [optional]

Return type

ApiSnapshotPolicyList

Authorization

basic

HTTP request headers

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

delete_policy

ApiSnapshotPolicy delete_policy(cluster_name, policy_name, service_name)

Deletes an existing snapshot policy.

Deletes an existing snapshot policy.

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.SnapshotsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
policy_name = 'policy_name_example' # str | Name of an existing snapshot policy.
service_name = 'service_name_example' # str | 

try:
    # Deletes an existing snapshot policy.
    api_response = api_instance.delete_policy(cluster_name, policy_name, service_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SnapshotsResourceApi->delete_policy: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
policy_name str Name of an existing snapshot policy.
service_name str

Return type

ApiSnapshotPolicy

Authorization

basic

HTTP request headers

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

list_h_base_snapshots_command

ApiCommand list_h_base_snapshots_command(cluster_name, service_name, storage=storage, storage_location=storage_location, table_name=table_name)

Starts a command that lists the available HBase snapshots from S3 or local HBase service.

Starts a command that lists the available HBase snapshots from S3 or local HBase service. If a table name is provided, it will list the snapshots for that table only, otherwise it will list all available snapshots.

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.SnapshotsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | 
storage = 'storage_example' # str | Location from where the snapshots should be fetched. (optional)
storage_location = 'storage_location_example' # str | Location of remote snapshots, if other than the local storage should be used. (optional)
table_name = 'table_name_example' # str | Table for which to list snapshots. If null is provided, it will list all snapshots for all tables. (optional)

try:
    # Starts a command that lists the available HBase snapshots from S3 or local HBase service.
    api_response = api_instance.list_h_base_snapshots_command(cluster_name, service_name, storage=storage, storage_location=storage_location, table_name=table_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SnapshotsResourceApi->list_h_base_snapshots_command: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str
storage str Location from where the snapshots should be fetched. [optional]
storage_location str Location of remote snapshots, if other than the local storage should be used. [optional]
table_name str Table for which to list snapshots. If null is provided, it will list all snapshots for all tables. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

read_history

ApiSnapshotCommandList read_history(cluster_name, policy_name, service_name, limit=limit, offset=offset, view=view)

Returns a list of commands triggered by a snapshot policy.

Returns a list of commands triggered by a snapshot policy.

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.SnapshotsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
policy_name = 'policy_name_example' # str | Name of an existing snapshot policy.
service_name = 'service_name_example' # str | 
limit = 20 # int | Maximum number of commands to retrieve. (optional) (default to 20)
offset = 0 # int | Index of first command to retrieve. (optional) (default to 0)
view = 'summary' # str | The view to materialize. (optional) (default to summary)

try:
    # Returns a list of commands triggered by a snapshot policy.
    api_response = api_instance.read_history(cluster_name, policy_name, service_name, limit=limit, offset=offset, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SnapshotsResourceApi->read_history: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
policy_name str Name of an existing snapshot policy.
service_name str
limit int Maximum number of commands to retrieve. [optional] [default to 20]
offset int Index of first command to retrieve. [optional] [default to 0]
view str The view to materialize. [optional] [default to summary]

Return type

ApiSnapshotCommandList

Authorization

basic

HTTP request headers

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

read_policies

ApiSnapshotPolicyList read_policies(cluster_name, service_name, view=view)

Returns information for all snapshot policies.

Returns information for all snapshot policies.

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.SnapshotsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | 
view = 'summary' # str | The view to materialize. (optional) (default to summary)

try:
    # Returns information for all snapshot policies.
    api_response = api_instance.read_policies(cluster_name, service_name, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SnapshotsResourceApi->read_policies: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str
view str The view to materialize. [optional] [default to summary]

Return type

ApiSnapshotPolicyList

Authorization

basic

HTTP request headers

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

read_policy

ApiSnapshotPolicy read_policy(cluster_name, policy_name, service_name, view=view)

Returns information for a specific snapshot policy.

Returns information for a specific snapshot policy.

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.SnapshotsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
policy_name = 'policy_name_example' # str | Name of an existing snapshot policy.
service_name = 'service_name_example' # str | 
view = 'summary' # str | The view to materialize. (optional) (default to summary)

try:
    # Returns information for a specific snapshot policy.
    api_response = api_instance.read_policy(cluster_name, policy_name, service_name, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SnapshotsResourceApi->read_policy: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
policy_name str Name of an existing snapshot policy.
service_name str
view str The view to materialize. [optional] [default to summary]

Return type

ApiSnapshotPolicy

Authorization

basic

HTTP request headers

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

update_policy

ApiSnapshotPolicy update_policy(cluster_name, policy_name, service_name, body=body)

Updates an existing snapshot policy.

Updates an existing snapshot policy.

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.SnapshotsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
policy_name = 'policy_name_example' # str | Name of an existing snapshot policy.
service_name = 'service_name_example' # str | 
body = cm_client.ApiSnapshotPolicy() # ApiSnapshotPolicy | Modified policy. (optional)

try:
    # Updates an existing snapshot policy.
    api_response = api_instance.update_policy(cluster_name, policy_name, service_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SnapshotsResourceApi->update_policy: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
policy_name str Name of an existing snapshot policy.
service_name str
body ApiSnapshotPolicy Modified policy. [optional]

Return type

ApiSnapshotPolicy

Authorization

basic

HTTP request headers

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