Skip to content

Commit

Permalink
Fix resource ID examples (#1011)
Browse files Browse the repository at this point in the history
The examples on the API concepts page are wrong, because they are missing the `providers` segment. This acts as the delimiter between the root scope and resource type.

The explanations are still OK. I don't think we need to describe `providers` in detail for users to get the point.

Co-authored-by: Aaron Crawfis <[email protected]>
  • Loading branch information
rynowak and AaronCrawfis authored Jan 2, 2024
1 parent dd90ff6 commit b23254e
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions docs/content/concepts/api-concept/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Each resource in Radius has a unique identifier called a resource id. Resource i
The common structure of a resource id is the following:

```txt
{rootScope}/{resourceNamespace}/{resourceType}/{resourceName}
{rootScope}/providers/{resourceNamespace}/{resourceType}/{resourceName}
```

### Root scope
Expand All @@ -86,47 +86,47 @@ The following tables shows some examples of resource ids from different resource

This example shows a Radius Application named `my-app` in the `my-group` resource group, running on the local cluster:

| Key | Example |
| ------------------ | ------------------------------------------------------------------------------------ |
| **Root scope** | `/planes/radius/local/resourceGroups/my-group` |
| **Namespace/Type** | `Applications.Core/applications` |
| **Name** | `my-app` |
| **Resource id** | `/planes/radius/local/resourceGroups/my-group/Applications.Core/applications/my-app` |
| Key | Example |
| ------------------ | ---------------------------------------------------------------------------------------------- |
| **Root scope** | `/planes/radius/local/resourceGroups/my-group` |
| **Namespace/Type** | `Applications.Core/applications` |
| **Name** | `my-app` |
| **Resource id** | `/planes/radius/local/resourceGroups/my-group/providers/Applications.Core/applications/my-app` |

#### Resource manager: AWS

This example shows an AWS Kinesis Stream named `my-stream` in the `0123456789` account, running in the `us-west-2` region:

| Key | Example |
| ------------------ | ------------------------------------------------------------------------------------- |
| **Root scope** | `/planes/aws/aws/accounts/01234556789/regions/us-west-2` |
| **Namespace/Type** | `AWS.Kinesis/Stream` |
| **Name** | `my-stream` |
| **Resource id** | `/planes/aws/aws/accounts/01234556789/regions/us-west-2/AWS.Kinesis/Stream/my-stream` |
| Key | Example |
| ------------------ | ----------------------------------------------------------------------------------------------- |
| **Root scope** | `/planes/aws/aws/accounts/01234556789/regions/us-west-2` |
| **Namespace/Type** | `AWS.Kinesis/Stream` |
| **Name** | `my-stream` |
| **Resource id** | `/planes/aws/aws/accounts/01234556789/regions/us-west-2/providers/AWS.Kinesis/Stream/my-stream` |

#### Resource manager: Azure

This example shows an Azure Storage Account named `myaccount` in the `00000000-0000-0000-0000-000000000000` subscription and `my-group` Azure resource group:

| Key | Example |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Root scope** | `/planes/azure/azurecloud/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-group` |
| **Namespace/Type** | `Microsoft.Storage/storageAccounts` |
| **Name** | `myaccount` |
| **Resource id** | `/planes/azure/azurecloud/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-group/Microsoft.Storage/storageAccounts/myaccount` |
| Key | Example |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Root scope** | `/planes/azure/azurecloud/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-group` |
| **Namespace/Type** | `Microsoft.Storage/storageAccounts` |
| **Name** | `myaccount` |
| **Resource id** | `/planes/azure/azurecloud/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-group/providers/Microsoft.Storage/storageAccounts/myaccount` |

## Resource lifecycle

The lifecycle of a resource is modeled using the HTTP methods that best match each lifecycle operation. Some operations like List do not provide a resource name because they operate on a collection of resources, however most do. Where possible, operations are idempotent, meaning that performing the same operation many times will produce the same result.

This section includes an example based on the Radius `Applications.Core/applications` type which represents a cloud-native application.

| Operation | HTTP Method | URL |
| ------------- | ----------- | -------------------------------------------------- |
| List | GET | `{rootScope}/Applications.Core/applications` |
| Read | GET | `{rootScope}/Applications.Core/applictions/my-app` |
| Create/Update | PUT | `{rootScope}/Applications.Core/applictions/my-app` |
| Delete | DELETE | `{rootScope}/Applications.Core/applictions/my-app` |
| Operation | HTTP Method | URL |
| ------------- | ----------- | ------------------------------------------------------------ |
| List | GET | `{rootScope}/providers/Applications.Core/applications` |
| Read | GET | `{rootScope}/providers/Applications.Core/applictions/my-app` |
| Create/Update | PUT | `{rootScope}/providers/Applications.Core/applictions/my-app` |
| Delete | DELETE | `{rootScope}/providers/Applications.Core/applictions/my-app` |

The example above demonstrates the CRUDL lifecycle APIs of a resource, all resource types provided by Radius follow this pattern.

Expand Down

0 comments on commit b23254e

Please sign in to comment.