Resource and Company ID

These IDs are required for various commands.

Getting Details of a Resource

You'll need a couple pieces of information to get the details of a single resource using the CLI. You'll need the company the resource is associated with and an identifier for the resource.

Company ID

If you want to get details of a resource, you'll need to know your company's ID in OpsCompass. You can get this by logging into OpsCompass. Your company will be in the URL.

For instance, if you're viewing the Inventory page, your URL will be:

https://app.opscompass.com/your_company_id/inventory

Here, the company id is your_company_id.

Resource ID

You'll also need to provide the ID of the resource you're trying to access. You can get this in two ways: from the cloud and from OpsCompass.

Each cloud has a different way to uniquely identify resources. For instance, Azure uses "Resource ID" and AWS uses "ARN".

When you have the cloud's ID for a resource, provide that with "--resource-id".

opscompass resources get --company your_company_id --resource-id "/subscriptions/abcdef00-0000-4000-a000-123456781234/resourceGroups/A-Resource-Group/providers/Microsoft.Web/sites/yoursite"

When you load a resource's details in the OpsCompass web experience, you'll see the resource's "OpsCompass ID" at the end of the URL. As we add more capabilities to search your resources using the CLI, this ID will be available through command output.

https://app.opscompass.com/your_company_id/inventory/1234567

Here, the OpsCompass ID of the resource is 1234567. When you have the OpsCompass ID for a resource, provide it with "--id"

opscompass resources get --company your_company_id --id 1234567