Create a snapshot

post

/api/20210901/snapshots

Create a new snapshot resource for an Analytics instance. Either create a new snapshot BAR file in Oracle Cloud Infrastructure (OCI) storage and register the snapshot with the Analytics instance ("type": "CREATE"). Or register an existing snapshot BAR file in OCI storage with the Analytics instance ("type": "REGISTER").

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json ()
Root Schema : Discriminator: type
Type: object
Discriminator: type

Discriminator Values

Match One Schema
Show Source
Nested Schema : CreateRegisterSnapshot
Object used to create and register a new snapshot BAR file.
Match All
Show Source
Nested Schema : RegisterSnapshot
Object used to register an existing snapshot BAR file.
Match All
Show Source
Nested Schema : NewSnapshot
Type: object
Object used to create a snapshot.
Show Source
Nested Schema : CreateRegisterSnapshot-allOf[1]
Type: object
Show Source
Nested Schema : Discriminator: type
Type: object
Discriminator: type

Discriminator Values

Match One Schema
Show Source
Nested Schema : SnapshotCreateType
Type: object
Type of snapshot creation. You can either create a new snapshot BAR file and register the new snapshot with your Analytics instance ("type": "CREATE") or register an existing snapshot BAR file ("type": "REGISTER").
Show Source
Nested Schema : OCINativeStorage
Oracle Cloud Infrastructure (OCI) storage details.
Match All
Show Source
Nested Schema : Storage
Type: object
Storage details.
Show Source
Nested Schema : OCINativeStorage-allOf[1]
Type: object
Show Source
Nested Schema : Discriminator: type
Type: object
Discriminator: type

Discriminator Values

Match One Schema
Show Source
  • OCIUserIdAuth
    Oracle Cloud Infrastructure (OCI) user ID authentication details. See [How to Generate an API Signing Key](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#two).
Nested Schema : StorageType
Type: object
Type of storage.
Show Source
Nested Schema : OCIUserIdAuth
Oracle Cloud Infrastructure (OCI) user ID authentication details. See [How to Generate an API Signing Key](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#two).
Match All
Show Source
Nested Schema : Auth
Type: object
Authentication details.
Show Source
Nested Schema : OCIUserIdAuth-allOf[1]
Type: object
Show Source
Nested Schema : AuthType
Type: object
Type of authentication.
Show Source
Nested Schema : PasswordBar
Snapshot BAR file protected with a password.
Match All
Show Source
Nested Schema : Bar
Type: object
Snapshot BAR file.
Show Source
Nested Schema : PasswordBar-allOf[1]
Type: object
Show Source
Nested Schema : RegisterSnapshot-allOf[1]
Type: object
Show Source
Back to Top

Response

202 Response

Asynchronous operation started.
Headers

400 Response

Bad Request (invalid query parameters, malformed headers, and so on).
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

Examples

You can either create a new snapshot ("type": "CREATE") or register an existing snapshot ("type": "REGISTER").

  • Example 1 (type=CREATE): Create a new snapshot of your Oracle Analytics instance, save the snapshot in cloud storage, and register the snapshot with your Oracle Analytics instance.
  • Example 2 (type=REGISTER): Register an existing snapshot in cloud storage with an Oracle Analytics instance.

In both cases, you need to specify connection information for the Oracle Cloud Infrastructure storage bucket where you want to save the new snapshot file or where the existing snapshot (BAR file) is stored.

Example 1 Create and register a snapshot

In this example, you create a snapshot (BAR file) of an Oracle Analytics instance, save the new BAR file in Oracle Cloud Infrastructure Object Storage, and register the snapshot with the Oracle Analytics instance.

cURL Example

First, create a JSON file that contains the properties required to create and register the snapshot (set the type property to CREATE).

If you haven't done so already, you must generate an Oracle Cloud Infrastructure API signing key. See How to Generate an API Signing Key. Before you add the key to the JSON file, you must Base64 encode the private key (ociPrivateKeyWrapped). For example, to generate a Base64 encoded string from your private key:

On Mac: cat myprivate-key.pem | base64 -o mywrapped-private-key.pem

On Linux: cat myprivate-key.pem | base64 -w 0 > mywrapped-private-key.pem

Note: Ensure that the private key file that you encode includes -----BEGIN and -----END tags.

When you specify a password for the snapshot, ensure it's between 8 and 50 characters long and contains at least one numeric character, one uppercase letter, and one lowercase letter.

For example, create a JSON file called new_snapshot.json that looks like this:
{
    "type": "CREATE",
    "name": "myfirstsnapshot",
    "storage": {
        "type": "OCI_NATIVE",
        "bucket": "mysnapshot-bucket",
        "auth": {
            "type": "OSS_AUTH_OCI_USER_ID",
            "ociRegion": "us-phoenix-1",
            "ociTenancyId": "ocid1.tenancy.oc1..aaaaa...",
            "ociUserId": "ocid1.user.oc1..aaaaaaaayuvg...",
            "ociKeyFingerprint": "ae:df:79:d2:...",
            "ociPrivateKeyWrapped": "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tL..."
        }
    },
    "bar": {
        "uri": "file:///myfolder/myfirstsnapshot.bar",
        "password": "snapshotPassword123"
    }
}

Then run the cURL command calling the JSON file (for example, new_snapshot.json):

curl -i \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --request POST 'https://<hostname>/api/20210901/snapshots' \
  -d @new_snapshot.json

Example 2 Register an existing snapshot

In this example, you register a snapshot (BAR file) that you previously uploaded to Oracle Cloud Infrastructure Object Storage with an Oracle Analytics instance. If you want to restore an Oracle Analytics instance from a snapshot in cloud storage, you need to register the snapshot with the Oracle Analytics instance.

cURL Example:

First, create a JSON file that contains the properties required to specify the BAR file you want to register (set the type property to REGISTER).

Like the create snapshot example, you must Base64 encode the private key before you add it to the JSON file (ociPrivateKeyWrapped).

For example, create a JSON file called registermy_snapshot.json that looks like this:

{
    "type": "REGISTER",
    "name": "mysavedsnapshot",
    "storage": {
        "type": "OCI_NATIVE",
        "bucket": "mysnapshot-bucket",
        "auth": {
            "type": "OSS_AUTH_OCI_USER_ID",
            "ociRegion": "us-phoenix-1",
            "ociTenancyId": "ocid1.tenancy.oc1..aaaaa...",
            "ociUserId": "ocid1.user.oc1..aaaaaaaayuvg...",
            "ociKeyFingerprint": "ae:df:79:d2:...",
            "ociPrivateKeyWrapped": "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tL..."
        }
    },
    "bar": {
        "uri": "file:///myfolder/mysavedsnapshot.bar"
    }
}

Then run the cURL command calling the JSON file (for example, registermy_snapshot.json):

curl -i \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --request POST 'https://<hostname>/api/20210901/snapshots' \
  -d @registermy_snapshot.json

Example of Response Header

Make a note of the oa-work-request-id in the response header. You can use this value to track the status of your operation.

oa-work-request-id: lfc-c2:152-cd:607

Example of Response Body

Alternatively, make a note of the workRequestId in the response body. You use this value to track the status of your operation.

{
    "workRequestId": "lfc-c2:152-cd:607"
}
Back to Top