Create a snapshot
/api/20210901/snapshots
Request
There are no request parameters for this operation.
- application/json
object
Discriminator Values
-
CreateRegisterSnapshot
Object used to create and register a new snapshot BAR file.
-
RegisterSnapshot
Object used to register an existing snapshot BAR file.
-
object
NewSnapshot
Object used to create a snapshot.
-
object
CreateRegisterSnapshot-allOf[1]
-
object
NewSnapshot
Object used to create a snapshot.
-
object
RegisterSnapshot-allOf[1]
object
-
name(required): string
-
storage(required):
Discriminator: type
Discriminator:
{ "propertyName":"type", "mapping":{ "OCI_NATIVE":"#/components/schemas/OCINativeStorage" } }
-
type(required): object
SnapshotCreateType
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").
object
-
bar:
PasswordBar
Snapshot BAR file protected with a password.
object
Discriminator Values
-
OCINativeStorage
Oracle Cloud Infrastructure (OCI) storage details.
object
-
type(required): string
Allowed Values:
[ "CREATE", "REGISTER" ]
-
object
Storage
Storage details.
-
object
OCINativeStorage-allOf[1]
object
-
auth(required):
Discriminator: type
Discriminator:
{ "propertyName":"type", "mapping":{ "OSS_AUTH_OCI_USER_ID":"#/components/schemas/OCIUserIdAuth" } }
-
type(required): object
StorageType
Type of storage.
object
-
bucket: string
Name of a storage bucket in OCI object storage.
object
Discriminator Values
-
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).
object
-
type(required): string
Allowed Values:
[ "OCI_NATIVE" ]
-
object
Auth
Authentication details.
-
object
OCIUserIdAuth-allOf[1]
object
-
type(required): object
AuthType
Type of authentication.
object
-
ociKeyFingerprint: string
Fingerprint of the public key.
-
ociPrivateKeyWrapped: string
Base64 encoded private key.
-
ociRegion: string
Name of the OCI region.
-
ociTenancyId: string
OCID of the tenancy.
-
ociUserId: string
OCID of the user.
object
-
type(required): string
Allowed Values:
[ "OSS_AUTH_OCI_USER_ID" ]
-
object
Bar
Snapshot BAR file.
-
object
PasswordBar-allOf[1]
object
-
uri: string
URI of the BAR file in storage.
object
-
password: string
Password of the BAR file.
object
-
bar: object
Bar
Snapshot BAR file.
Response
202 Response
400 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
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.
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" }