5 Account

This section describes the Compute Classic CLI commands you can use to view accounts.

An account is used in Compute Classic to store credentials that must be used to access another service. For example, you use an account to define the credentials and other details of the Oracle Cloud Infrastructure Object Storage Classic instance in which you store machine images.

Before running the CLI commands described in this section, make sure that you've installed the CLI client and set up the required environment variables as described in Preparing to Use the CLI.

account list

Retrieves details of all the accounts in the specified container.

You can use this command to get details of the account that you must specify while creating a machine image.

Required Role

To complete this task, you must have the Compute_Monitor or Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Syntax

opc compute account list container

Example

opc -f json compute account list /Compute-acme

Sample Output

{
 "result": [
  {
   "credentials": {},
   "description": "",
   "name": "/Compute-acme/cloud_storage",
   "uri": "api-z999.compute.us0.oraclecloud.com/account/Compute-acme/cloud_storage"
  },
  {
   "credentials": {},
   "description": null,
   "name": "/Compute-acme/default",
   "uri": "api-z999.compute.us0.oraclecloud.com/account/Compute-acme/default"
  }
 ]
}

account discover

Retrieves a list of the accounts in the specified container.

Required Role

To complete this task, you must have the Compute_Monitor or Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Syntax

opc compute account discover container

Example

opc -f json compute account discover /Compute-acme

Sample Output

{
  "result": [
    "/Compute-acme/cloud_storage",
    "/Compute-acme/default"  ]
}

account get

Retrieves details of the specified account.

Required Role

To complete this task, you must have the Compute_Monitor or Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Syntax

opc compute account get name

Example

opc -f json compute account get /Compute-acme/cloud_storage

Sample Output

{
   "credentials": {},
   "description": "",
   "name": "/Compute-acme/cloud_storage",
   "uri": "https://api-z999.compute.us0.oraclecloud.com/account/Compute-acme/cloud_storage"
}