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): string
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").
object
-
bar:
PasswordBar
Snapshot BAR file protected with a password.
object
Discriminator Values
-
OCINativeStorage
Oracle Cloud Infrastructure (OCI) storage details.
-
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", "OCI_RESOURCE_PRINCIPAL":"#/components/schemas/OCIResourcePrincipalAuth" } }
-
type(required): string
Allowed Values:
[ "OCI_NATIVE" ]
Type of storage.
object
-
bucket: string
Name of a storage bucket in OCI object storage.
-
bucketOciNamespace: string
Namespace where the storage bucket exists. Only required when the bucket is located in a different tenancy.
-
bucketOciRegion: string
Region where the storage bucket exists. Only required when the bucket is located in a different region.
object
Discriminator Values
-
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.
-
object
Auth
Authentication details.
-
object
OCIUserIdAuth-allOf[1]
-
object
Auth
Authentication details.
-
object
OCIResourcePrincipalAuth-allOf[1]
object
-
type(required): string
Allowed Values:
[ "OSS_AUTH_OCI_USER_ID", "OCI_RESOURCE_PRINCIPAL" ]
Type of authentication.
object
-
ociKeyFingerprint: string
Fingerprint of the public key.
-
ociPrivateKeyWrapped: string
Base64URL encoded private key.
-
ociRegion: string
Name of the OCI region.
-
ociTenancyId: string
OCID of the tenancy.
-
ociUserId: string
OCID of the user.
object
-
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 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.
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 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: !#$%&'()+,-./:;<=>?@[]^_`{|}~*.
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" }