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
Object used to create and register a new snapshot BAR file.
Object used to create and register a new snapshot BAR file.
Show Source
Nested Schema : RegisterSnapshot
Object used to register an existing snapshot BAR file.
Match All
Object used to register an existing snapshot BAR file.
Object used to register an existing snapshot BAR file.
Show Source
Nested Schema : NewSnapshot
Type: object
Object used to create a snapshot.
Show Source
  • Discriminator: type
    Discriminator: { "propertyName":"type", "mapping":{ "OCI_NATIVE":"#/components/schemas/OCINativeStorage" } }
  • Allowed Values: [ "CREATE", "REGISTER" ]
    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").
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 : OCINativeStorage
Oracle Cloud Infrastructure (OCI) storage details.
Match All
Oracle Cloud Infrastructure (OCI) storage details.
Oracle Cloud Infrastructure (OCI) storage details.
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
    Deprecated, 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).
  • OCIResourcePrincipalAuth
    Oracle Cloud Infrastructure (OCI) Resource Principal authentication details.
Nested Schema : OCIUserIdAuth
Deprecated, 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
Deprecated, 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).
Deprecated, 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).
Show Source
Nested Schema : OCIResourcePrincipalAuth
Oracle Cloud Infrastructure (OCI) Resource Principal authentication details.
Match All
Oracle Cloud Infrastructure (OCI) Resource Principal authentication details.
Oracle Cloud Infrastructure (OCI) Resource Principal authentication details.
Show Source
Nested Schema : Auth
Type: object
Authentication details.
Show Source
Nested Schema : OCIUserIdAuth-allOf[1]
Type: object
Show Source
Nested Schema : OCIResourcePrincipalAuth-allOf[1]
Type: object
Nested Schema : PasswordBar
Snapshot BAR file protected with a password.
Match All
Snapshot BAR file protected with a password.
Snapshot BAR file protected with a password.
Show Source
Nested Schema : Bar
Type: object
Snapshot BAR file.
Show Source
Nested Schema : PasswordBar-allOf[1]
Type: object
Show Source
  • Password of the snapshot. The password must be between 14 and 50 characters long and contain at least one numeric character, one uppercase letter, one lowercase letter, and one special character.
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 Cloud 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 already done so, you must create a bucket suitable for snapshot storage, and create an IAM policy that gives the Oracle Analytics Cloud instance read and write access to the bucket. See Prerequisites. If your bucket isn't in the same region or namespace as your Oracle Analytics Cloud instances, use the parameters bucketOciRegion and bucketOciNamespace to specify these locations.

When you specify a password for the snapshot, ensure it's between 14 and 50 characters long and contains at least one numeric character, one uppercase letter, one lowercase letter, and one special character. Allowable special characters include: !#$%&'()+,-./:;<=>?@[]^_`{|}~*.

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",
        "bucketOciRegion": "uk-london-1",
        "bucketOciNamespace": "idaabb1122xxyyzz",
        "auth": {
            "type": "OCI_RESOURCE_PRINCIPAL"
        }
    },
    "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

Note:

Oracle recommends that you authenticate access to snapshot storage using a resource principal and set the auth type to OCI_RESOURCE_PRINCIPAL, as shown in the above example. If you decide to use user principal authentication (an API signing key), use the value OSS_AUTH_OCI_USER_ID with the following additional parameters:

"auth": {
            "type": "OSS_AUTH_OCI_USER_ID",
            "ociRegion": "uk-london-1",
            "ociTenancyId": "ocid1.tenancy.oc1..aaaaa...",
            "ociUserId": "ocid1.user.oc1..aaaaaaaayuvg...",
            "ociKeyFingerprint": "ae:df:79:d2:...",
            "ociPrivateKeyWrapped": "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tL..."
        }

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:

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

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",
        "bucketOciRegion": "uk-london-1",
        "bucketOciNamespace": "idaabb1122xxyyzz",
        "auth": {
            "type": "OCI_RESOURCE_PRINCIPAL"
        }
    },
    "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