# Job

A Job is an act of collecting external cloud resources through plugins.

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

\
\


## Job

**Job Methods:**

| Method                                                                                                            | Request                                                                                                                       | Response                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [**delete**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#delete)   | [JobRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#jobrequest)           | [Empty](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#empty)       |
| [**get**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#get)         | [JobRequest](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#jobrequest)           | [JobInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#jobinfo)   |
| [**list**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#list)       | [JobsQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#jobsquery)             | [JobsInfo](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#jobsinfo) |
| [**analyze**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#analyze) | [JobAnalyzeQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#jobanalyzequery) | [Struct](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#struct)     |
| [**stat**](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#stat)       | [JobStatQuery](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#jobstatquery)       | [Struct](https://github.com/cloudforet-io/api-doc/blob/master/content/en/inventory/v1/Job/README.md#struct)     |

\


### delete

Deletes a specific Job. You must specify the `job_id` of the Job to delete.

> **POST** /inventory/v1/job/delete

\{{< tabs " delete " >\}}

\{{< tab "Request Example" >\}}

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

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

\{{< highlight json >\}} { "job\_id": "job-123456789012", } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### get

Gets a specific Job. Prints detailed information about the Job, including its state, total tasks, and collector info.

> **POST** /inventory/v1/job/get

\{{< tabs " get " >\}}

\{{< tab "Request Example" >\}}

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

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

\{{< highlight json >\}} { "job\_id": "job-123456789012", } \{{< /highlight >\}} \{{< /tab >\}}

\{{< tab "Response Example" >\}}

[JobInfo](#JOBINFO)

* **job\_id** (string) `Required`
* **status** (Status) `Required`
* **total\_tasks** (int32) `Required`
* **remained\_tasks** (int32) `Required`
* **success\_tasks** (int32) `Required`
* **failure\_tasks** (int32) `Required`
* **request\_secret\_id** (string) `Required`
* **request\_workspace\_id** (string) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **collector\_id** (string) `Required`
* **plugin\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
* **finished\_at** (string) `Required`

\{{< highlight json >\}} { "job\_id": "job-123456789012", "status": "ERROR", "filter": {}, "total\_tasks": 2, "collector\_info": { "collector\_id": "collector-123456789012", "name": "Jenkins Collector", "state": "ENABLED", "plugin\_info": { "plugin\_id": "plugin-jenkins-inven-collector", "version": "0.1.1" }, "provider": "jenkins", "capability": {}, "is\_public": true }, "domain\_id": "domain-123456789012", "created\_at": "2022-01-01T10:00:01.389Z", "updated\_at": "2022-01-01T10:00:01.389Z", "finished\_at": "2022-01-01T10:02:11.270Z" } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### list

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

> **POST** /inventory/v1/job/list

\{{< tabs " list " >\}}

\{{< tab "Request Example" >\}}

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

* **query** (Query)
* **job\_id** (string)
* **status** (JobStatus)
* **workspace\_id** (string)
* **collector\_id** (string)
* **plugin\_id** (string)

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

\{{< tab "Response Example" >\}}

[JobsInfo](#JOBSINFO)

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

\{{< highlight json >\}} { "results": \[ { "job\_id": "job-3b124006c2d2", "status": "SUCCESS", "filter": {}, "total\_tasks": 2, "collector\_info": { "collector\_id": "collector-accd02663b3d", "name": "openstack-collector", "state": "ENABLED", "plugin\_info": { "plugin\_id": "plugin-openstack-inven-collector", "version": "0.4.2.20220616.134758" }, "provider": "openstack", "capability": { "supported\_schema": \[ "openstack\_credentials" ] }, "is\_public": true }, "resource\_group": "DOMAIN", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-06-17T08:00:01.225Z", "updated\_at": "2022-06-17T08:00:01.225Z", "finished\_at": "2022-06-17T08:00:15.197Z" }, { "job\_id": "job-587a3d3b4db3", "status": "SUCCESS", "filter": {}, "total\_tasks": 3, "collector\_info": { "collector\_id": "collector-2c0847644f39", "name": "AWS stat-kwon Collector", "state": "ENABLED", "plugin\_info": { "plugin\_id": "plugin-30d21ef75a5d", "version": "1.13.13.20220610.143142" }, "provider": "aws", "capability": { "supported\_schema": \[ "aws\_access\_key" ] }, "is\_public": true }, "resource\_group": "DOMAIN", "domain\_id": "domain-58010aa2e451", "created\_at": "2022-06-17T08:00:00.407Z", "updated\_at": "2022-06-17T08:00:00.407Z", "finished\_at": "2022-06-17T08:07:32.023Z" } ], "total\_count": 2 } \{{< /highlight >\}} \{{< /tab >\}}

\{{< /tabs >\}}

\


### analyze

> **POST** /inventory/v1/job/analyze

\


### stat

> **POST** /inventory/v1/job/stat

\
\


## Message

### JobAnalyzeQuery

*   **query** (AnalyzeQuery) `Required`

    \


### JobInfo

* **job\_id** (string) `Required`
* **status** (Status) `Required`
* **total\_tasks** (int32) `Required`
* **remained\_tasks** (int32) `Required`
* **success\_tasks** (int32) `Required`
* **failure\_tasks** (int32) `Required`
* **request\_secret\_id** (string) `Required`
* **request\_workspace\_id** (string) `Required`
* **resource\_group** (ResourceGroup) `Required`
* **domain\_id** (string) `Required`
* **workspace\_id** (string) `Required`
* **collector\_id** (string) `Required`
* **plugin\_id** (string) `Required`
* **created\_at** (string) `Required`
* **updated\_at** (string) `Required`
*   **finished\_at** (string) `Required`

    \


### JobRequest

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

    \


### JobStatQuery

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

    \


### JobsInfo

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

    \


### JobsQuery

* **query** (Query)
* **job\_id** (string)
* **status** (JobStatus)
* **workspace\_id** (string)
* **collector\_id** (string)
*   **plugin\_id** (string)

    \
