# Update a key-value store

`PUT /apis/cra.diagrid.io/v1beta1/projects/{ProjectId}/kvstores/{ProjectSubresourceId}`

Update an existing key-value store by replacing its configuration.

## Request

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `ProjectId` | string | Yes | Unique identifier of the project. |
| `ProjectSubresourceId` | string | Yes | Unique identifier of the project subresource. |

### Request body

The key-value store configuration to apply.

`application/json`

- `apiVersion` (string)
- `kind` (string)
- `metadata` (object)
  - `name` (string)
  - `uid` (string)
  - `resourceVersion` (integer)
  - `createdAt` (string)
  - `updatedAt` (string)
  - `deletedAt` (string)
  - `labels` (object<string, string>)
  - `annotations` (object)
- `spec` (object) — KVStoreSpec represents the spec for a KVStore.
  - `projectId` (string) — Required. Read-only. Immutable. ProjectID is server-derived from the request path; the client-supplied value is ignored.
  - `createConnection` (boolean) — Write-only. Deprecated: use createComponent instead.
  - `connectionMetadata` (object[]) — Write-only.
    - `name` (string)
    - `value`
      - Any of:
        - **string**
        - **integer**
        - **number**
        - **boolean**
    - `secretKeyRef` (object) — SecretKeyRef is a reference to a secret holding the value for the name/value item.
      - `name` (string) — Secret name.
      - `key` (string) — Field in the secret.
  - `connectionName` (string) — Write-only.
  - `createComponent` (boolean) — Write-only.
  - `componentMetadata` (object[]) — Write-only.
    - `name` (string)
    - `value`
      - Any of:
        - **string**
        - **integer**
        - **number**
        - **boolean**
    - `secretKeyRef` (object) — SecretKeyRef is a reference to a secret holding the value for the name/value item.
      - `name` (string) — Secret name.
      - `key` (string) — Field in the secret.
  - `componentName` (string) — Write-only.
  - `scopes` (string[]) — Write-only.
- `status` (object) — KVStoreStatus represents the status of a key-value store.
  - `status` (string) — Status is the current processing status of the resource.
  - `updatedAt` (string) — UpdatedAt is the time of the last status update.
  - `messages` (object[]) — Messages contains any status messages, such as error details.
    - `message` (string)
  - `instances` (object[]) — Instances includes the status for each instance of the resource.
    - `cluster` (string) — Cluster is the name of the cluster hosting this instance.
    - `region` (string) — Region is the region where the instance is located (e.g. "us-east-1").
    - `placementId` (string) — PlacementID is the project placement this instance belongs to (e.g. "1").
    - `status` (string) — Status is the current processing status of the resource.
    - `updatedAt` (string) — UpdatedAt is the time of the last status update.
    - `messages` (object[]) — Messages contains any status messages, such as error details.
      - `message` (string)
  - `itemCount` (integer (int64))
  - `itemsError` (string)
  - `connections` (string[])

Example:

```json
{
  "apiVersion": "cra.diagrid.io/v1beta1",
  "kind": "KVStore",
  "metadata": {
    "name": "kvstore"
  },
  "spec": {
    "projectId": "my-project"
  }
}
```

`application/vnd.api+json`

JSONAPI.org specification KV store response wrapper for UI.

- `data` (object) — Required.
  - `type` (string) — Type of the resource object.
  - `id` (string) — Unique identifier of the resource object.
  - `attributes` (object)
    - `apiVersion` (string)
    - `kind` (string)
    - `metadata` (object)
      - `name` (string)
      - `uid` (string)
      - `resourceVersion` (integer)
      - `createdAt` (string)
      - `updatedAt` (string)
      - `deletedAt` (string)
      - `labels` (object<string, string>)
      - `annotations` (object)
    - `spec` (object) — KVStoreSpec represents the spec for a KVStore.
      - `projectId` (string) — Required. Read-only. Immutable. ProjectID is server-derived from the request path; the client-supplied value is ignored.
      - `createConnection` (boolean) — Write-only. Deprecated: use createComponent instead.
      - `connectionMetadata` (object[]) — Write-only.
        - `name` (string)
        - `value`
          - Any of:
            - **string**
            - **integer**
            - **number**
            - **boolean**
        - `secretKeyRef` (object) — SecretKeyRef is a reference to a secret holding the value for the name/value item.
          - `name` (string) — Secret name.
          - `key` (string) — Field in the secret.
      - `connectionName` (string) — Write-only.
      - `createComponent` (boolean) — Write-only.
      - `componentMetadata` (object[]) — Write-only.
        - `name` (string)
        - `value`
          - Any of:
            - **string**
            - **integer**
            - **number**
            - **boolean**
        - `secretKeyRef` (object) — SecretKeyRef is a reference to a secret holding the value for the name/value item.
          - `name` (string) — Secret name.
          - `key` (string) — Field in the secret.
      - `componentName` (string) — Write-only.
      - `scopes` (string[]) — Write-only.
    - `status` (object) — KVStoreStatus represents the status of a key-value store.
      - `status` (string) — Status is the current processing status of the resource.
      - `updatedAt` (string) — UpdatedAt is the time of the last status update.
      - `messages` (object[]) — Messages contains any status messages, such as error details.
        - `message` (string)
      - `instances` (object[]) — Instances includes the status for each instance of the resource.
        - `cluster` (string) — Cluster is the name of the cluster hosting this instance.
        - `region` (string) — Region is the region where the instance is located (e.g. "us-east-1").
        - `placementId` (string) — PlacementID is the project placement this instance belongs to (e.g. "1").
        - `status` (string) — Status is the current processing status of the resource.
        - `updatedAt` (string) — UpdatedAt is the time of the last status update.
        - `messages` (object[]) — Messages contains any status messages, such as error details.
          - `message` (string)
      - `itemCount` (integer (int64))
      - `itemsError` (string)
      - `connections` (string[])
  - `relationships` (object<string, object>) — Members of the relationships object represent references from the resource object in which it's defined to other resource objects.
    - Any of:
      - **option 1**
      - **option 2**
      - **option 3**
  - `links` (object<string, object>) — Link members related to the primary data.
    - One of:
      - **string (uri-reference)** — A string containing the link's URL.
      - **object**
        - `href` (string (uri-reference)) — Required. A string containing the link's URL.
        - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
  - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.

## Responses

### 202 — Accepted for asynchronous processing.

### 403 — You are not authorized to perform this action.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.

### 404 — The key-value store was not found.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.

### 409 — The request conflicts with the current state of the key-value store.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.

### default — Unexpected error.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
