OCI

Ops can integrate with your existing Oracle Cloud Infrastructure account. You can use Ops CLI to create and upload an image in OCI account. Once, you have uploaded image, you can also create an instance with a particular image using CLI.

Pre-requisites

  1. Create an Oracle Cloud Infrastructure account (https://www.oracle.com/cloud/).

  2. Set up a config file with the required credentials.

    1. Go to User Settings page, whose link should be seen after clicking on profile avatar in top navigation bar.

    2. Click on API Keys link.

    3. Click on Add API Key button. A modal with further instructions will appear.

    4. Download the private key.

    5. Click on Add button. You should see a configuration preview in the modal.

    6. Copy configuration preview content to ~/.oci/config file in your machine. Create the directory .oci in your home folder if it does not exist yet.

    7. Update the key_file in OCI configuration file with the path of the file you downloaded in step 4.

  3. Setup a bucket in your OCI account to receive your images.

    1. Access Object Storage page.

    2. Click on Create Bucket button.

    3. Access bucket details page and copy Namespace value to ops configuration file.

  4. Copy your bucket details to ops configuration.

    {
    "CloudConfig": {
     "BucketName": "<bucket_name>",
     "BucketNamespace": "<bucket_namespace>"
    }
    }
  5. You are now able to use ops commands to interact with your OCI Account

Image Operations

Create Image

You can create an image in OCI with the following command.

For creating an image using a particular package, you need to provide the package name to ops image create command with -p option.

List Images

You can list existing images on OCI with ops image list -t oci -c config.json.

Delete Image

ops image delete <imagename> can be used to delete an image from OCI.

Instance Operations

Create Instance

After the successful creation of an image in OCI, we can create an instance from an existing image.

List Instances

You can list instance on OCI using ops instance list command.

Get Logs for Instance

Work in progress.

Delete Instance

ops instance delete command can be used to delete instance on OCI.

Last updated

Was this helpful?