CreateElasticsearchSnapshotRepository#

Description#

Request to add a snapshot repository to an Elasticsearch or ELK service.

Request Parameters#

  • parameters — The parametersof the snapshot repository.

    • Type: Dict

    • Required: Yes

  • serviceId — The PaaS service ID.

    • Type: String

    • Required: Yes

Response Elements#

Examples#

Managing PaaS services in K2 Cloud via API requires a customized version of the boto3 library:

import boto3

session = boto3.Session(
    aws_access_key_id="<AWS_ACCESS_KEY_ID>",
    aws_secret_access_key="<AWS_SECRET_ACCESS_KEY>",
    region_name="",
)

paas_client = session.client(
    'paas',
    endpoint_url='https://paas.k2.cloud/',
)

pipeline = paas_client.create_elasticsearch_snapshot_repository(
    serviceId='fm-cluster-C27426C0',
    parameters={
        "enabled": False,
        "fromExistingService": False,
        "bucketName": "mybackups",
        "userLogin": "backup@k2.cloud",
        "directoryName": "elasticsearch_snapshots",
    },
)

Or c2-paas utility from K2 Cloud API Client software suite:

c2-paas CreateElasticsearchSnapshotRepository serviceId fm-cluster-C27426C0 parameters.enabled False parameters.fromExistingService False parameters.bucketName mybackups parameters.userLogin backup@k2.cloud parameters.directoryName elasticsearch_snapshots