# Server

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

## Server

{% hint style="info" %}
**Server Methods:**
{% endhint %}

| NO | Method                     | Request Type                                  | Response Type                                                                                                      | Description |
| -- | -------------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | [**create**](#create)      | [CreateServerRequest](#createserverrequest)   | [ServerInfo](#serverinfo)                                                                                          |             |
| 2  | [**update**](#update)      | [UpdateServerRequest](#updateserverrequest)   | [ServerInfo](#serverinfo)                                                                                          |             |
| 3  | [**pin\_data**](#pin_data) | [PinServerDataRequest](#pinserverdatarequest) | [ServerInfo](#serverinfo)                                                                                          |             |
| 4  | [**delete**](#delete)      | [ServerRequest](#serverrequest)               | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto)   |             |
| 5  | [**get**](#get)            | [GetServerRequest](#getserverrequest)         | [ServerInfo](#serverinfo)                                                                                          |             |
| 6  | [**list**](#list)          | [ServerQuery](#serverquery)                   | [ServersInfo](#serversinfo)                                                                                        |             |
| 7  | [**stat**](#stat)          | [ServerStatQuery](#serverstatquery)           | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |

### create

> **POST** /inventory/v1/servers

| Type     | Message                                     |
| -------- | ------------------------------------------- |
| Request  | [CreateServerRequest](#createserverrequest) |
| Response | [ServerInfo](#serverinfo)                   |

### update

> **PUT** /inventory/v1/server/{server\_id}

| Type     | Message                                     |
| -------- | ------------------------------------------- |
| Request  | [UpdateServerRequest](#updateserverrequest) |
| Response | [ServerInfo](#serverinfo)                   |

### pin\_data

> **PUT** /inventory/v1/server/{server\_id}/pin-data

| Type     | Message                                       |
| -------- | --------------------------------------------- |
| Request  | [PinServerDataRequest](#pinserverdatarequest) |
| Response | [ServerInfo](#serverinfo)                     |

### delete

> **DELETE** /inventory/v1/server/{server\_id}

| Type     | Message                                                                                                          |
| -------- | ---------------------------------------------------------------------------------------------------------------- |
| Request  | [ServerRequest](#serverrequest)                                                                                  |
| Response | [google.protobuf.Empty](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto) |

### get

> **GET** /inventory/v1/server/{server\_id}

| Type     | Message                               |
| -------- | ------------------------------------- |
| Request  | [GetServerRequest](#getserverrequest) |
| Response | [ServerInfo](#serverinfo)             |

### list

> **GET** /inventory/v1/servers
>
> **POST** /inventory/v1/servers/search

| Type     | Message                     |
| -------- | --------------------------- |
| Request  | [ServerQuery](#serverquery) |
| Response | [ServersInfo](#serversinfo) |

### stat

> **POST** /inventory/v1/servers/stat

| Type     | Message                                                                                                            |
| -------- | ------------------------------------------------------------------------------------------------------------------ |
| Request  | [ServerStatQuery](#serverstatquery)                                                                                |
| Response | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |

## Message

### CreateServerRequest

| No | Field                 | Type                                                                                                               | Required | Description |
| -- | --------------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
| 1  | name                  | string                                                                                                             | ❌        |             |
| 2  | state                 | <ul><li>STATE\_NONE</li><li>PENDING</li><li>INSERVICE</li><li>MAINTENANCE</li><li>CLOSED</li><li>DELETED</li></ul> | ❌        |             |
| 3  | primary\_ip\_address  | string                                                                                                             | ❌        |             |
| 4  | server\_type          | <ul><li>SERVER\_TYPE\_NONE</li><li>BAREMETAL</li><li>VM</li><li>HYPERVISOR</li><li>UNKNOWN</li></ul>               | ❌        |             |
| 5  | os\_type              | <ul><li>OS\_TYPE\_NONE</li><li>LINUX</li><li>WINDOWS</li></ul>                                                     | ✅        |             |
| 6  | provider              | string                                                                                                             | ❌        |             |
| 7  | cloud\_service\_group | string                                                                                                             | ❌        |             |
| 8  | cloud\_service\_type  | string                                                                                                             | ❌        |             |
| 9  | region\_code          | string                                                                                                             | ❌        |             |
| 10 | data                  | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 11 | metadata              | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 12 | nics                  | [list of ServerNIC](#servernic)                                                                                    | ❌        |             |
| 13 | disks                 | [list of ServerDisk](#serverdisk)                                                                                  | ❌        |             |
| 14 | reference             | [ServerReference](#serverreference)                                                                                | ❌        |             |
| 15 | tags                  | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |             |
| 16 | project\_id           | string                                                                                                             | ❌        |             |
| 17 | domain\_id            | string                                                                                                             | ✅        |             |

### GetServerRequest

| No | Field      | Type           | Required | Description |
| -- | ---------- | -------------- | :------: | ----------- |
| 1  | server\_id | string         |     ✅    |             |
| 2  | domain\_id | string         |     ✅    |             |
| 3  | only       | list of string |     ❌    |             |

### PinServerDataRequest

| No | Field      | Type           | Required | Description |
| -- | ---------- | -------------- | :------: | ----------- |
| 1  | server\_id | string         |     ✅    |             |
| 2  | keys       | list of string |     ✅    |             |
| 3  | domain\_id | string         |     ✅    |             |

### ServerDisk

| No | Field         | Type                                                                                                               | Required | Description |
| -- | ------------- | ------------------------------------------------------------------------------------------------------------------ | :------: | ----------- |
| 1  | device\_index | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto)                    |     ✅    |             |
| 2  | device        | string                                                                                                             |     ❌    |             |
| 3  | disk\_type    | string                                                                                                             |     ❌    |             |
| 4  | size          | float                                                                                                              |     ❌    |             |
| 5  | tags          | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ❌    |             |

### ServerInfo

| No | Field                 | Type                                                                                                               | Description |
| -- | --------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| 1  | server\_id            | string                                                                                                             |             |
| 2  | name                  | string                                                                                                             |             |
| 3  | state                 | <ul><li>STATE\_NONE</li><li>PENDING</li><li>INSERVICE</li><li>MAINTENANCE</li><li>CLOSED</li><li>DELETED</li></ul> |             |
| 4  | primary\_ip\_address  | string                                                                                                             |             |
| 5  | ip\_addresses         | [google.protobuf.ListValue](https://developers.google.com/protocol-buffers/docs/reference/overview)                |             |
| 6  | server\_type          | <ul><li>SERVER\_TYPE\_NONE</li><li>BAREMETAL</li><li>VM</li><li>HYPERVISOR</li><li>UNKNOWN</li></ul>               |             |
| 7  | os\_type              | <ul><li>OS\_TYPE\_NONE</li><li>LINUX</li><li>WINDOWS</li></ul>                                                     |             |
| 8  | provider              | string                                                                                                             |             |
| 9  | cloud\_service\_group | string                                                                                                             |             |
| 10 | cloud\_service\_type  | string                                                                                                             |             |
| 11 | region\_code          | string                                                                                                             |             |
| 12 | data                  | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 13 | metadata              | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 14 | nics                  | [list of ServerNIC](#servernic)                                                                                    |             |
| 15 | disks                 | [list of ServerDisk](#serverdisk)                                                                                  |             |
| 16 | reference             | [ServerReference](#serverreference)                                                                                |             |
| 17 | tags                  | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 18 | collection\_info      | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |             |
| 19 | project\_id           | string                                                                                                             |             |
| 20 | domain\_id            | string                                                                                                             |             |
| 21 | created\_at           | string                                                                                                             |             |
| 22 | updated\_at           | string                                                                                                             |             |
| 23 | deleted\_at           | string                                                                                                             |             |

### ServerNIC

| No | Field               | Type                                                                                                               | Required | Description |
| -- | ------------------- | ------------------------------------------------------------------------------------------------------------------ | :------: | ----------- |
| 1  | device\_index       | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto)                    |     ✅    |             |
| 2  | device              | string                                                                                                             |     ❌    |             |
| 3  | nic\_type           | string                                                                                                             |     ❌    |             |
| 4  | ip\_addresses       | list of string                                                                                                     |     ✅    |             |
| 5  | cidr                | string                                                                                                             |     ❌    |             |
| 6  | mac\_address        | string                                                                                                             |     ❌    |             |
| 7  | public\_ip\_address | string                                                                                                             |     ❌    |             |
| 8  | tags                | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) |     ❌    |             |

### ServerQuery

| No | Field                 | Type                                                                                                 | Required | Description |
| -- | --------------------- | ---------------------------------------------------------------------------------------------------- | -------- | ----------- |
| 1  | query                 | [spaceone.api.core.v1.Query](https://spaceone-dev.gitbook.io/api-reference/common-v1/search-query)   | ❌        |             |
| 2  | server\_id            | string                                                                                               | ❌        |             |
| 3  | name                  | string                                                                                               | ❌        |             |
| 4  | state                 | string                                                                                               | ❌        |             |
| 5  | primary\_ip\_address  | string                                                                                               | ❌        |             |
| 6  | ip\_addresses         | string                                                                                               | ❌        |             |
| 7  | server\_type          | <ul><li>SERVER\_TYPE\_NONE</li><li>BAREMETAL</li><li>VM</li><li>HYPERVISOR</li><li>UNKNOWN</li></ul> | ❌        |             |
| 8  | os\_type              | <ul><li>OS\_TYPE\_NONE</li><li>LINUX</li><li>WINDOWS</li></ul>                                       | ❌        |             |
| 9  | provider              | string                                                                                               | ❌        |             |
| 10 | cloud\_service\_group | string                                                                                               | ❌        |             |
| 11 | cloud\_service\_type  | string                                                                                               | ❌        |             |
| 12 | region\_code          | string                                                                                               | ❌        |             |
| 13 | resource\_group\_id   | string                                                                                               | ❌        |             |
| 14 | project\_id           | string                                                                                               | ❌        |             |
| 15 | domain\_id            | string                                                                                               | ✅        |             |

### ServerReference

| No | Field          | Type   | Description |
| -- | -------------- | ------ | ----------- |
| 1  | resource\_id   | string |             |
| 2  | external\_link | string |             |

### ServerRequest

| No | Field      | Type   | Required | Description |
| -- | ---------- | ------ | :------: | ----------- |
| 1  | server\_id | string |     ✅    |             |
| 2  | domain\_id | string |     ✅    |             |

### ServerStatQuery

| No | Field               | Type                                                                                                             | Required | Description |
| -- | ------------------- | ---------------------------------------------------------------------------------------------------------------- | :------: | ----------- |
| 1  | query               | [spaceone.api.core.v1.StatisticsQuery](https://spaceone-dev.gitbook.io/api-reference/common-v1/statistics-query) |     ✅    |             |
| 2  | domain\_id          | string                                                                                                           |     ✅    |             |
| 3  | resource\_group\_id | string                                                                                                           |     ❌    |             |

### ServersInfo

| No | Field        | Type                                                                                            | Description |
| -- | ------------ | ----------------------------------------------------------------------------------------------- | ----------- |
| 1  | results      | [list of ServerInfo](#serverinfo)                                                               |             |
| 2  | total\_count | [int32](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/type.proto) |             |

### UpdateServerRequest

| No | Field                 | Type                                                                                                               | Required | Description      |
| -- | --------------------- | ------------------------------------------------------------------------------------------------------------------ | -------- | ---------------- |
| 1  | server\_id            | string                                                                                                             | ✅        | server unique id |
| 2  | name                  | string                                                                                                             | ❌        |                  |
| 3  | state                 | <ul><li>STATE\_NONE</li><li>PENDING</li><li>INSERVICE</li><li>MAINTENANCE</li><li>CLOSED</li><li>DELETED</li></ul> | ❌        |                  |
| 4  | primary\_ip\_address  | string                                                                                                             | ❌        |                  |
| 5  | server\_type          | <ul><li>SERVER\_TYPE\_NONE</li><li>BAREMETAL</li><li>VM</li><li>HYPERVISOR</li><li>UNKNOWN</li></ul>               | ❌        |                  |
| 6  | os\_type              | <ul><li>OS\_TYPE\_NONE</li><li>LINUX</li><li>WINDOWS</li></ul>                                                     | ❌        |                  |
| 7  | provider              | string                                                                                                             | ❌        |                  |
| 8  | cloud\_service\_group | string                                                                                                             | ❌        |                  |
| 9  | cloud\_service\_type  | string                                                                                                             | ❌        |                  |
| 10 | region\_code          | string                                                                                                             | ❌        |                  |
| 11 | data                  | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |                  |
| 12 | metadata              | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |                  |
| 13 | nics                  | [list of ServerNIC](#servernic)                                                                                    | ❌        |                  |
| 14 | disks                 | [list of ServerDisk](#serverdisk)                                                                                  | ❌        |                  |
| 15 | reference             | [ServerReference](#serverreference)                                                                                | ❌        |                  |
| 16 | tags                  | [google.protobuf.Struct](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/struct.proto) | ❌        |                  |
| 17 | project\_id           | string                                                                                                             | ❌        |                  |
| 18 | domain\_id            | string                                                                                                             | ✅        |                  |
| 19 | release\_region       | bool                                                                                                               | ❌        |                  |
| 20 | release\_project      | bool                                                                                                               | ❌        |                  |
