Oracle by Example brandingConnecting to OCI Object Storage

section 0Before You Begin

This 45-minute Oracle by Example (OBE) shows you how to create Connections and Connectors for OCI Object Storage.

What Do You Need?

To perform the steps in this OBE, you must have generated API Keys and gathered important information needed to configure Oracle Cloud Infrastructure (OCI) connections in Orchestrator.


section 1Creating a Connection for Object Storage Service

  1. On the Orchestrator Studio Home page, click the Connections icon.
  2. On the Connections side panel, click the New button and select REST from the drop-down list.
  3. On the Connection design page, complete these fields:
    • Name - Enter OCI OBJECT STORAGE.
    • Description - Enter a description if desired.
    • User/Role - Enter the user or role that will be authorized to run the originating orchestration. The user can be an EnterpriseOne user, role, or *PUBLIC.
    • Environment - Enter the environment where the orchestration runs.
  4. On the Service Information tab, enter the URL for accessing the OCI services in the Endpoint field.

    For example, the object storage URL in the Phoenix region is: https://objectstorage.us-phoenix-1.oraclecloud.com

    Description of service_information.png follows
    Service Information
  5. Click the Security tab and from the Security Policy drop-down list, select the OCI API Key-Based Authentication.
    • In the OCI Configuration File field, copy and paste the OCI configuration file details from your OCI API Key.
    • In the Private Key File Name field, drag the OCI private key (.pem) file from your system and drop it on the field name. Alternatively, you can click and then upload the key file.
      Description of security.png follows
      Security
  6. Enter proxy information on the Proxy tab if necessary for your network configuration.
  7. Click Save.

section 2Creating a Connector to Create a Bucket in OCI Object Storage

  1. On the Orchestrator Studio Home page, click the Connectors icon.
  2. Click the New button and select REST.
  3. On the Connector page, complete the following fields:
    • Name - Create Bucket.
    • Enter Short Description - Enter a description if desired.
  4. From the REST drop-down list, select the connection (OCI OBJECT STORAGE), which you have created in the previous step.
  5. Change the HTTP Method to POST.
  6. Expand the Pathing section and in the Value grid, build the path to the REST service endpoint by entering the following value in the first row:
    n/${namespaceName}/b/
    After entering these values, the service path displayed above the Value grid should look like this:
    https://objectstorage.us-phoenix-1.oraclecloud.com/n/${namespaceName}/b/
  7. In the Headers section keep the File Upload option off.
    1. In the Body section enter the following:
       
       {
      "compartmentId": "${compartment_ocid}",
      "objectEventsEnabled": true,
      "name": "${BucketName}"
      }
      Description of body_section.png follows
      Body Section
  8. Expand the Response section and then expand the Output subsection.
    1. Enable the Include Response Status option.
    2. Change the default variable name to: httpstatus.
      Description of include_response_status.png follows
      Include Response Status
  9. Save the connector.

section 3Creating a Connector to Upload the Image in OCI Object Storage

  1. On the Orchestrator Studio Home page, click the Connectors icon.
  2. Click the New button and select REST.
  3. On the Connector page, complete the following fields:
    • Name - PUT Object File.
    • Enter Short Description - Enter a description if desired.
  4. From the REST drop-down list, select the connection (OCI OBJECT STORAGE) which you have created in the previous step.
  5. Change the HTTP Method to a PUT.
  6. Expand the Pathing section and in the Value grid, build the path to the REST service endpoint by entering the following value in the first row:

    n/${namespaceName}/b/${bucketName}/o/${objectName}

    After entering these values, the service path displayed above the Value grid should look like this:
    https://objectstorage.us-phoenix-1.oraclecloud.com/n/${namespaceName}/b/${bucketName}/o/${objectName}

  7. In the Headers section,
    • Enable the File Upload option. The Binary Body option is enabled by default.
    • Add a key for Accept with value application/json.
  8. In the File section,
    • Select the File option.
    • Do not change the default values for Source File Name (${filename}) and Use Temporary File Location (checked).
      Description of file_section.png follows
      File Section
  9. Expand the Response section and then expand the Output subsection.
    1. Enable the Include Response Status option.
    2. Change the default variable name to: httpstatus.
  10. Save the connector.

section 4Creating a Connector to Delete the Image in OCI Object Storage

  1. On the Orchestrator Studio Home page, click the Connectors icon.
  2. Click the New button and select REST.
  3. On the Connector page, complete the following fields:
    • Name - Enter OCI Delete Object.
    • Enter Short Description - Enter a description if desired.
  4. From the REST drop-down list, select the connection (OCI OBJECT STORAGE) which you have created in the previous step.
  5. Change the HTTP Method to a DELETE.
  6. Expand the Pathing section and in the Value grid, build the path to the REST service endpoint by entering the following value in the first row:

    n/${namespaceName}/b/${bucketName}/o/${objectName}

    After entering these values, the service path displayed above the Value grid should look like this:
    https://objectstorage.us-phoenix-1.oraclecloud.com/n/${namespaceName}/b/${bucketName}/o/${objectName}

  7. Leave the defaults in Parameters, Header, and Body sections blank.
    Description of oci_delete_object.png follows
    OCI Delete Object
  8. Expand the Response section and then expand the Output subsection.
    1. Enable the Include Response Status option.
    2. Change the default variable name to: deleteStatus.
      Description of output.png follows
      Output
  9. Save the connector.

section 5Creating a Connector to Delete a Bucket in OCI Object Storage

  1. On the Orchestrator Studio Home page, click the Connectors icon.
  2. Click the New button and select REST.
  3. On the Connector page, complete the following fields:
    • Name - Delete Bucket.
    • Enter Short Description - Enter a description if desired.
  4. From the REST drop-down list, select the connection (OCI OBJECT STORAGE) which you have created in the previous step.
  5. Change the HTTP Method to a DELETE.
  6. Expand the Pathing section and in the Value grid, build the path to the REST service endpoint by entering the following value in the first row:

    n/${namespaceName}/b/${bucketName}/

    After entering these values, the service path displayed above the Value grid should look like this:
    https://objectstorage.us-phoenix-1.oraclecloud.com/n/${namespaceName}/b/${bucketName}/

  7. Leave the defaults in Parameters, Header, and Body sections blank.
  8. Expand the Response section and then expand the Output subsection.
    • Enable the Include Response Status option.
    • Change the default variable name to: httpStatus.
  9. Save the connector.