> For the complete documentation index, see [llms.txt](https://cloudforet.gitbook.io/cloudforet-apis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cloudforet.gitbook.io/cloudforet-apis/content/en/repository/v1/schema.md).

# Schema

A Schema is a data structure used in all domains. For example, data forms of Google OAuth2 credentials or AWS access keys can be a Schema resource.

> **Package : spaceone.api.repository.v1**

\ <br>

## Schema

**Schema Methods:**

| Method                                                                                                              | Request                                                                                                                                                 | Response                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [**create**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#create) | [CreateSchemaRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#createschemarequest)               | [SchemaInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#schemainfo)   |
| [**update**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#update) | [UpdateSchemaRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#updateschemarequest)               | [SchemaInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#schemainfo)   |
| [**delete**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#delete) | [SchemaRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#schemarequest)                           | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#empty)             |
| [**get**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#get)       | [GetRepositorySchemaRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#getrepositoryschemarequest) | [SchemaInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#schemainfo)   |
| [**list**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#list)     | [SchemaQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#schemaquery)                               | [SchemasInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#schemasinfo) |
| [**stat**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#stat)     | [SchemaStatQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#schemastatquery)                       | [Struct](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#struct)           |

<br>

### create

Creates a new Schema. You must specify the parameters: `service_type`, `name`, and `schema`(data structure). With the parameter `domain_id`, you can choose whether you will create a Schema in `Local` or externally. The Schema created includes `repository_info`, information about where the resource is managed.

> **POST** /repository/v1/schema/create

{{< tabs " create " >}}

{{< tab "Request Example" >}}

[CreateSchemaRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#createschemarequest)

* **name** (string) `Required`
* **service\_type** (string) `Required`
* **schema\_id** (string) `Required`
* **schema** (Struct) `Required`
* **domain\_id** (string) `Required`
* **labels** (ListValue)
* **tags** (Struct)
* **project\_id** (string)

{{< highlight json >}} { "name": "slack\_webhook", "service\_type": "secret.credentials", "schema": {}, "labels": \[], "tags": { "description": "Slack Webhook" }, "domain\_id": "domain-987654321098" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SchemaInfo](#SCHEMAINFO)

* **name** (string) `Required`
* **service\_type** (string) `Required`
* **schema\_id** (string) `Required`
* **schema** (Struct) `Required`
* **labels** (ListValue) `Required`
* **tags** (Struct) `Required`
* **repository\_info** (RepositoryInfo) `Required`
* **project\_id** (string) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "name": "slack\_webhook", "service\_type": "secret.credentials", "schema": {}, "labels": \[], "tags": { "description": "Slack Webhook" }, "repository\_info": { "repository\_id": "repo-123456789012", "name": "Local", "repository\_type": "local" }, "domain\_id": "domain-987654321098", "created\_at": "2022-01-01T05:46:49.929Z", "updated\_at": "2022-01-01T05:46:49.929Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### update

Updates a specific Schema. You can make changes in Schema settings, including `name`, `schema`, `labels`, and `tags`.

> **POST** /repository/v1/schema/update

{{< tabs " update " >}}

{{< tab "Request Example" >}}

[UpdateSchemaRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#updateschemarequest)

* **name** (string) `Required`
* **domain\_id** (string) `Required`
* **schema** (Struct)
* **labels** (ListValue)
* **tags** (Struct)

{{< highlight json >}} { "name": "slack\_webhook\_test", "schema": {}, "labels": \[], "tags": {}, "domain\_id": "domain-987654321098" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SchemaInfo](#SCHEMAINFO)

* **name** (string) `Required`
* **service\_type** (string) `Required`
* **schema\_id** (string) `Required`
* **schema** (Struct) `Required`
* **labels** (ListValue) `Required`
* **tags** (Struct) `Required`
* **repository\_info** (RepositoryInfo) `Required`
* **project\_id** (string) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "name": "slack\_webhook", "service\_type": "secret.credentials", "schema": {}, "labels": \[], "tags": { "description": "Slack Webhook" }, "repository\_info": { "repository\_id": "repo-123456789012", "name": "Local", "repository\_type": "local" }, "domain\_id": "domain-987654321098", "created\_at": "2022-01-01T05:46:49.929Z", "updated\_at": "2022-01-01T05:46:49.929Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### delete

Deletes a specific Schema. You must specify the `name` of the Schema to delete, as the `name` is an identifier of Schema resources.

> **POST** /repository/v1/schema/delete

{{< tabs " delete " >}}

{{< tab "Request Example" >}}

[SchemaRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#schemarequest)

* **name** (string) `Required`
* **domain\_id** (string) `Required`
* **schema\_id** (string)

{{< highlight json >}} { "name": "slack\_webhook" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### get

Gets a specific Schema. You must specify the `name` of the Schema to get, as the `name` is an identifier of Schema resources. You can use the parameter `repository_id` to limit the scope of the method to a specific Repository.

> **POST** /repository/v1/schema/get

{{< tabs " get " >}}

{{< tab "Request Example" >}}

[GetRepositorySchemaRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#getrepositoryschemarequest)

* **name** (string) `Required`
* **domain\_id** (string) `Required`
* **repository\_id** (string)
* **only** (string) `Repeated`
* **schema\_id** (string)

{{< highlight json >}} { "name": "slack\_webhook", "repository\_id": "repo-123456789012" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SchemaInfo](#SCHEMAINFO)

* **name** (string) `Required`
* **service\_type** (string) `Required`
* **schema\_id** (string) `Required`
* **schema** (Struct) `Required`
* **labels** (ListValue) `Required`
* **tags** (Struct) `Required`
* **repository\_info** (RepositoryInfo) `Required`
* **project\_id** (string) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

{{< highlight json >}} { "name": "slack\_webhook", "service\_type": "secret.credentials", "schema": {}, "labels": \[], "tags": { "description": "Slack Webhook" }, "repository\_info": { "repository\_id": "repo-123456789012", "name": "Local", "repository\_type": "local" }, "domain\_id": "domain-987654321098", "created\_at": "2022-01-01T05:46:49.929Z", "updated\_at": "2022-01-01T05:46:49.929Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### list

Gets a list of all Schemas in a specific Repository. The parameter `repository_id` is used as an identifier of a Repository to get its list of Schemas. You can use a query to get a filtered list of Schemas.

> **POST** /repository/v1/schema/list

{{< tabs " list " >}}

{{< tab "Request Example" >}}

[SchemaQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/repository/v1/Schema/README.md#schemaquery)

* **project\_id** (string) `Required`
* **repository\_id** (string) `Required`
* **domain\_id** (string) `Required`
* **query** (Query)
* **name** (string)
* **service\_type** (string)
* **schema\_id** (string)
* **state** (State)

{{< highlight json >}} { "query": {}, "name": "slack\_webhook", "service\_type": "secret.credentials", "repository\_id": "repo-123456789012" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[SchemasInfo](#SCHEMASINFO)

* **results** (SchemaInfo) `Repeated` `Required`
* **total\_count** (int32) `Required`

{{< highlight json >}} { "results": \[ { "name": "slack\_webhook", "service\_type": "secret.credentials", "schema": {}, "labels": \[], "tags": { "description": "Slack Webhook" }, "repository\_info": { "repository\_id": "repo-123456789012", "name": "Local", "repository\_type": "local" }, "domain\_id": "domain-987654321098", "created\_at": "2022-01-01T10:20:09.064Z", "updated\_at": "2022-01-01T10:20:09.064Z" } ], "total\_count": 1 } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### stat

> **POST** /repository/v1/schema/stat

\ <br>

## Message

### CreateSchemaRequest

* **name** (string) `Required`
* **service\_type** (string) `Required`
* **schema\_id** (string) `Required`
* **schema** (Struct) `Required`
* **domain\_id** (string) `Required`
* **labels** (ListValue)
* **tags** (Struct)
* **project\_id** (string)

  <br>

### GetRepositorySchemaRequest

* **name** (string) `Required`
* **domain\_id** (string) `Required`
* **repository\_id** (string)
* **only** (string) `Repeated`
* **schema\_id** (string)

  <br>

### SchemaInfo

* **name** (string) `Required`
* **service\_type** (string) `Required`
* **schema\_id** (string) `Required`
* **schema** (Struct) `Required`
* **labels** (ListValue) `Required`
* **tags** (Struct) `Required`
* **repository\_info** (RepositoryInfo) `Required`
* **project\_id** (string) `Required`
* **domain\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`

  <br>

### SchemaQuery

* **project\_id** (string) `Required`
* **repository\_id** (string) `Required`
* **domain\_id** (string) `Required`
* **query** (Query)
* **name** (string)
* **service\_type** (string)
* **schema\_id** (string)
* **state** (State)

  <br>

### SchemaRequest

* **name** (string) `Required`
* **domain\_id** (string) `Required`
* **schema\_id** (string)

  <br>

### SchemaStatQuery

* **query** (StatisticsQuery) `Required`
* **repository\_id** (string) `Required`
* **domain\_id** (string) `Required`

  <br>

### SchemasInfo

* **results** (SchemaInfo) `Repeated` `Required`
* **total\_count** (int32) `Required`

  <br>

### UpdateSchemaRequest

* **name** (string) `Required`
* **domain\_id** (string) `Required`
* **schema** (Struct)
* **labels** (ListValue)
* **tags** (Struct)

  <br>
