> 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/inventory/v1/collector.md).

# Collector

A Collector is a plugin instance collecting cloud resources. A Collector can collect the resource data manually or by a pre-set schedule.

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

\ <br>

## Collector

**Collector Methods:**

| Method                                                                                                                               | Request                                                                                                                                           | Response                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| [**create**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#create)                | [CreateCollectorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#createcollectorrequest) | [CollectorInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorinfo)   |
| [**update**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#update)                | [UpdateCollectorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#updatecollectorrequest) | [CollectorInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorinfo)   |
| [**update\_plugin**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#update_plugin) | [UpdatePluginRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#updatepluginrequest)       | [CollectorInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorinfo)   |
| [**verify\_plugin**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#verify_plugin) | [VerifyPluginRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#verifypluginrequest)       | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#empty)                   |
| [**delete**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#delete)                | [CollectorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorrequest)             | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#empty)                   |
| [**get**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#get)                      | [CollectorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorrequest)             | [CollectorInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorinfo)   |
| [**list**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#list)                    | [CollectorQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorquery)                 | [CollectorsInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorsinfo) |
| [**stat**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#stat)                    | [CollectorStatQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorstatquery)         | [Struct](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#struct)                 |
| [**collect**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collect)              | [CollectRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectrequest)                 | [JobInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#jobinfo)               |

<br>

### create

Creates a new Collector with information of the plugin to use. Information of the plugin includes `version`, `provider`, and `upgrade_mode`.

> **POST** /inventory/v1/collector/create

{{< tabs " create " >}}

{{< tab "Request Example" >}}

[CreateCollectorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#createcollectorrequest)

* **name** (string) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **schedule** (Scheduled)
* **provider** (string)
* **secret\_filter** (SecretFilter)
* **tags** (Struct)
* **workspace\_id** (string)

{{< highlight json >}} { "name": "AWS Collector", "plugin\_info": { "plugin\_id": "plugin-30d21ef75a5d", "version": "1.13.13", "options": {}, "metadata": { "filter\_format": \[], "supported\_schedules": \[ "hours" ], "supported\_resource\_type": \[ "inventory.CloudService", "inventory.CloudServiceType", "inventory.Region" ], "supported\_features": \[ "garbage\_collection" ] }, "upgrade\_mode": "AUTO" }, "schedule": { "state": "ENABLED", "hours": \[0, 6, 12, 18] }, "secret\_filter": { "state": "ENABLED", "secrets": \["secret-xxx", "secret-yyy"], "service\_accounts": \["sa-xxx", "sa-yyy"], "schemas": \["schema-xxx", "schema-yyy"] }, "tags": { "type": "test" }, } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[CollectorInfo](#COLLECTORINFO)

* **collector\_id** (string) `Required`
* **name** (string) `Required`
* **provider** (string) `Required`
* **capability** (Struct) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **schedule** (Scheduled) `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **last\_collected\_at** (string) `Required`

{{< highlight json >}} { "collector\_id": "collector-2c0847644f39", "name": "AWS Collector", "plugin\_info": { "plugin\_id": "plugin-30d21ef75a5d", "version": "1.13.13", "options": {}, "metadata": { "supported\_schedules": \[ "hours" ], "supported\_resource\_type": \[ "inventory.CloudService", "inventory.CloudServiceType", "inventory.Region" ], "filter\_format": \[], "supported\_features": \[ "garbage\_collection" ] }, "upgrade\_mode": "AUTO" }, "tags": { "type": "test" }, "created\_at": "2022-06-17T06:33:27.195Z", "domain\_id": "domain-58010aa2e451", "provider": "aws", "capability": { "supported\_schema": \[ "aws\_access\_key" ] }, "schedule": { "state": "ENABLED", "hours": \[0, 6, 12, 18] }, "secret\_filter": { "state": "ENABLED", "secrets": \["secret-xxx", "secret-yyy"], "service\_accounts": \["sa-xxx", "sa-yyy"], "schemas": \["schema-xxx", "schema-yyy"] }, "last\_collected\_at": "2022-06-17T06:33:27.195Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### update

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

> **POST** /inventory/v1/collector/update

{{< tabs " update " >}}

{{< tab "Request Example" >}}

[UpdateCollectorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#updatecollectorrequest)

* **collector\_id** (string) `Required`
* **name** (string)
* **schedule** (Scheduled)
* **secret\_filter** (SecretFilter)
* **tags** (Struct)

{{< highlight json >}} { "collector\_id": "collector-2c0847644f39", "name": "New AWS Collector", "plugin\_info": { "plugin\_id": "plugin-30d21ef75a5d", "version": "1.14.0", "provider": "aws", "upgrade\_mode": "MANUAL" }, "schedule": { "state": "ENABLED", "hours": \[0, 6, 12, 18] }, "secret\_filter": { "state": "ENABLED", "secrets": \["secret-xxx", "secret-yyy"], "service\_accounts": \["sa-xxx", "sa-yyy"], "schemas": \["schema-xxx", "schema-yyy"] }, "tags": { "a": "b" } } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[CollectorInfo](#COLLECTORINFO)

* **collector\_id** (string) `Required`
* **name** (string) `Required`
* **provider** (string) `Required`
* **capability** (Struct) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **schedule** (Scheduled) `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **last\_collected\_at** (string) `Required`

{{< highlight json >}} { "collector\_id": "collector-2c0847644f39", "name": "AWS Collector", "plugin\_info": { "plugin\_id": "plugin-30d21ef75a5d", "version": "1.13.13", "options": {}, "metadata": { "supported\_schedules": \[ "hours" ], "supported\_resource\_type": \[ "inventory.CloudService", "inventory.CloudServiceType", "inventory.Region" ], "filter\_format": \[], "supported\_features": \[ "garbage\_collection" ] }, "upgrade\_mode": "AUTO" }, "tags": { "type": "test" }, "created\_at": "2022-06-17T06:33:27.195Z", "domain\_id": "domain-58010aa2e451", "provider": "aws", "capability": { "supported\_schema": \[ "aws\_access\_key" ] }, "schedule": { "state": "ENABLED", "hours": \[0, 6, 12, 18] }, "secret\_filter": { "state": "ENABLED", "secrets": \["secret-xxx", "secret-yyy"], "service\_accounts": \["sa-xxx", "sa-yyy"], "schemas": \["schema-xxx", "schema-yyy"] }, "last\_collected\_at": "2022-06-17T06:33:27.195Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### update\_plugin

Updates the plugin of a specific Collector. This method resets the plugin data in the Collector to update the `metadata`.

> **POST** /inventory/v1/collector/update-plugin

{{< tabs " update\_plugin " >}}

{{< tab "Response Example" >}}

[CollectorInfo](#COLLECTORINFO)

* **collector\_id** (string) `Required`
* **name** (string) `Required`
* **provider** (string) `Required`
* **capability** (Struct) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **schedule** (Scheduled) `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **last\_collected\_at** (string) `Required`

{{< highlight json >}} { "collector\_id": "collector-2c0847644f39", "name": "AWS Collector", "plugin\_info": { "plugin\_id": "plugin-30d21ef75a5d", "version": "1.13.13", "options": {}, "metadata": { "supported\_schedules": \[ "hours" ], "supported\_resource\_type": \[ "inventory.CloudService", "inventory.CloudServiceType", "inventory.Region" ], "filter\_format": \[], "supported\_features": \[ "garbage\_collection" ] }, "upgrade\_mode": "AUTO" }, "tags": { "type": "test" }, "created\_at": "2022-06-17T06:33:27.195Z", "domain\_id": "domain-58010aa2e451", "provider": "aws", "capability": { "supported\_schema": \[ "aws\_access\_key" ] }, "schedule": { "state": "ENABLED", "hours": \[0, 6, 12, 18] }, "secret\_filter": { "state": "ENABLED", "secrets": \["secret-xxx", "secret-yyy"], "service\_accounts": \["sa-xxx", "sa-yyy"], "schemas": \["schema-xxx", "schema-yyy"] }, "last\_collected\_at": "2022-06-17T06:33:27.195Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### verify\_plugin

Verifies the plugin of a specific Collector. This method validates the plugin data, `version` and `endpoint`.

> **POST** /inventory/v1/collector/verify-plugin

<br>

### delete

Deletes a specific Collector. You must specify the `collector_id` of the Collector to delete.

> **POST** /inventory/v1/collector/delete

{{< tabs " delete " >}}

{{< tab "Request Example" >}}

[CollectorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorrequest)

* **collector\_id** (string) `Required`

{{< highlight json >}} { "collector\_id": "collector-f2e4e9cc7f21" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### get

Gets a specific Collector. Prints detailed information about the Collector, including its state, basic information, and the plugin information used for cloud resource collection.

> **POST** /inventory/v1/collector/get

{{< tabs " get " >}}

{{< tab "Request Example" >}}

[CollectorRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorrequest)

* **collector\_id** (string) `Required`

{{< highlight json >}} { "collector\_id": "collector-f2e4e9cc7f21" } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[CollectorInfo](#COLLECTORINFO)

* **collector\_id** (string) `Required`
* **name** (string) `Required`
* **provider** (string) `Required`
* **capability** (Struct) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **schedule** (Scheduled) `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **last\_collected\_at** (string) `Required`

{{< highlight json >}} { "collector\_id": "collector-2c0847644f39", "name": "AWS Collector", "plugin\_info": { "plugin\_id": "plugin-30d21ef75a5d", "version": "1.13.13", "options": {}, "metadata": { "supported\_schedules": \[ "hours" ], "supported\_resource\_type": \[ "inventory.CloudService", "inventory.CloudServiceType", "inventory.Region" ], "filter\_format": \[], "supported\_features": \[ "garbage\_collection" ] }, "upgrade\_mode": "AUTO" }, "tags": { "type": "test" }, "created\_at": "2022-06-17T06:33:27.195Z", "domain\_id": "domain-58010aa2e451", "provider": "aws", "capability": { "supported\_schema": \[ "aws\_access\_key" ] }, "schedule": { "state": "ENABLED", "hours": \[0, 6, 12, 18] }, "secret\_filter": { "state": "ENABLED", "secrets": \["secret-xxx", "secret-yyy"], "service\_accounts": \["sa-xxx", "sa-yyy"], "schemas": \["schema-xxx", "schema-yyy"] }, "last\_collected\_at": "2022-06-17T06:33:27.195Z" } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### list

Gets a list of all Collectors. You can use a query to get a filtered list of Collectors.

> **POST** /inventory/v1/collector/list

{{< tabs " list " >}}

{{< tab "Request Example" >}}

[CollectorQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Collector/README.md#collectorquery)

* **query** (Query) `Required`
* **collector\_id** (string) `Required`
* **name** (string) `Required`
* **secret\_filter\_state** (State) `Required`
* **schedule\_state** (State) `Required`
* **workspace\_id** (string) `Required`
* **plugin\_id** (string) `Required`

{{< highlight json >}} { "query": {} } {{< /highlight >}} {{< /tab >}}

{{< tab "Response Example" >}}

[CollectorsInfo](#COLLECTORSINFO)

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

{{< highlight json >}} { "results": \[ { "collector\_id": "collector-2c0847644f39", "name": "AWS Collector", "plugin\_info": { "plugin\_id": "plugin-30d21ef75a5d", "version": "1.13.13", "options": {}, "metadata": { "supported\_schedules": \[ "hours" ], "supported\_resource\_type": \[ "inventory.CloudService", "inventory.CloudServiceType", "inventory.Region" ], "filter\_format": \[], "supported\_features": \[ "garbage\_collection" ] }, "upgrade\_mode": "AUTO" }, "tags": { "type": "test" }, "created\_at": "2022-06-17T06:33:27.195Z", "domain\_id": "domain-58010aa2e451", "provider": "aws", "capability": { "supported\_schema": \[ "aws\_access\_key" ] }, "schedule": { "state": "ENABLED", "hours": \[0, 6, 12, 18] }, "secret\_filter": { "state": "ENABLED", "secrets": \["secret-xxx", "secret-yyy"], "service\_accounts": \["sa-xxx", "sa-yyy"], "schemas": \["schema-xxx", "schema-yyy"] }, "last\_collected\_at": "2022-06-17T06:33:27.195Z" }, { "collector\_id": "collector-2c0847644f39", "name": "AWS Collector", "plugin\_info": { "plugin\_id": "plugin-30d21ef75a5d", "version": "1.13.13", "options": {}, "metadata": { "supported\_schedules": \[ "hours" ], "supported\_resource\_type": \[ "inventory.CloudService", "inventory.CloudServiceType", "inventory.Region" ], "filter\_format": \[], "supported\_features": \[ "garbage\_collection" ] }, "upgrade\_mode": "AUTO" }, "tags": { "type": "test" }, "created\_at": "2022-06-17T06:33:27.195Z", "domain\_id": "domain-58010aa2e451", "provider": "aws", "capability": { "supported\_schema": \[ "aws\_access\_key" ] }, "schedule": { "state": "ENABLED", "hours": \[0, 6, 12, 18] }, "secret\_filter": { "state": "ENABLED", "secrets": \["secret-xxx", "secret-yyy"], "service\_accounts": \["sa-xxx", "sa-yyy"], "schemas": \["schema-xxx", "schema-yyy"] }, "last\_collected\_at": "2022-06-17T06:33:27.195Z" } ], "total\_count": 2 } {{< /highlight >}} {{< /tab >}}

{{< /tabs >}}

<br>

### stat

> **POST** /inventory/v1/collector/stat

<br>

### collect

> **POST** /inventory/v1/collector/collect

\ <br>

## Message

### CollectRequest

* **collector\_id** (string) `Required`
* **secret\_id** (string)

  <br>

### CollectorInfo

* **collector\_id** (string) `Required`
* **name** (string) `Required`
* **provider** (string) `Required`
* **capability** (Struct) `Required`
* **secret\_filter** (SecretFilter) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **schedule** (Scheduled) `Required`
* **tags** (Struct) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **created\_at** (string) `Required`
* **last\_collected\_at** (string) `Required`

  <br>

### CollectorQuery

* **query** (Query) `Required`
* **collector\_id** (string) `Required`
* **name** (string) `Required`
* **secret\_filter\_state** (State) `Required`
* **schedule\_state** (State) `Required`
* **workspace\_id** (string) `Required`
* **plugin\_id** (string) `Required`

  <br>

### CollectorRequest

* **collector\_id** (string) `Required`

  <br>

### CollectorStatQuery

* **query** (StatisticsQuery) `Required`

  <br>

### CollectorsInfo

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

  <br>

### CreateCollectorRequest

* **name** (string) `Required`
* **plugin\_info** (PluginInfo) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **schedule** (Scheduled)
* **provider** (string)
* **secret\_filter** (SecretFilter)
* **tags** (Struct)
* **workspace\_id** (string)

  <br>

### PluginInfo

* **plugin\_id** (string) `Required`
* **version** (string) `Required`
* **options** (Struct) `Required`
* **metadata** (Struct) `Required`
* **upgrade\_mode** (UpgradeMode) `Required`

  <br>

### Scheduled

* **state** (ScheduledState) `Required`
* **hours** (int32) `Repeated` `Required`

  <br>

### SecretFilter

* **state** (SecretFilterState) `Required`
* **secrets** (string) `Repeated` `Required`
* **service\_accounts** (string) `Repeated` `Required`
* **schemas** (string) `Repeated` `Required`
* **exclude\_secrets** (string) `Repeated` `Required`
* **exclude\_service\_accounts** (string) `Repeated` `Required`
* **exclude\_schemas** (string) `Repeated` `Required`

  <br>

### UpdateCollectorRequest

* **collector\_id** (string) `Required`
* **name** (string)
* **schedule** (Scheduled)
* **secret\_filter** (SecretFilter)
* **tags** (Struct)

  <br>

### UpdatePluginRequest

* **collector\_id** (string) `Required`
* **version** (string)
* **options** (Struct)
* **upgrade\_mode** (UpgradeMode)

  <br>

### VerifyPluginRequest

* **collector\_id** (string) `Required`
* **secret\_id** (string)

  <br>
