# Deploymentregion

The DeploymentRegion element defines a geographical region that contains one or more i3D.net data center (dc) locations.

<figure><img src="https://3255620342-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTxqXHcEUC6lhXmjD6wE0%2Fuploads%2FB3s5WHDSz8MvyHyjPXgt%2FDeploymentConfigurationOverviewDepReg.png?alt=media&#x26;token=0ad2a253-bb00-4bf8-b398-7a988cd27556" alt=""><figcaption></figcaption></figure>

Figure 1: Highlighting where the DeploymentRegion elements belong in the overview

## Usage

The amount of DeploymentRegion elements you can create is limited by the amount of i3D.net data center locations you are renting bare metal servers in.

## Element structure

| Property                    | Value type                                                                                                     | Required  | Description                                                                                                                                                                                                                                                                                 |
| --------------------------- | -------------------------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                          | string                                                                                                         | Read-only | Unique identifier of this element                                                                                                                                                                                                                                                           |
| name                        | string                                                                                                         | Yes       | Name of the deployment region                                                                                                                                                                                                                                                               |
| i3dDcLocationIds            | \[int]                                                                                                         | Yes       | All the i3D.net DC location IDs configured for this DeploymentRegion. You can get available IDs via [`GET /cloud/dcLocation`](https://www.i3d.net/docs/api/v3/game-publisher#/Cloud/getCloudDcLocations)                                                                                    |
| i3dDcLocationIdsToBeRemoved | \[int]                                                                                                         | No        | i3D.net DC location IDs scheduled for removal from this region                                                                                                                                                                                                                              |
| minimumCapacity             | int                                                                                                            | No        | The minimum amount of game instances that should always be deployed in this region. Leave null to use the global value set in DeploymentProfile.minimumCapacity                                                                                                                             |
| maximumCapacity             | int                                                                                                            | No        | The maximum amount of game instances that can be deployed in this region. Leave null to use the global value set in DeploymentProfile.maximumCapacity                                                                                                                                       |
| bufferValue                 | int                                                                                                            | No        | Override for deploymentRegion.bufferValue, to be applied only to this deployment region. Null value means that the bufferValue provided in the deploymentProfile will persist                                                                                                               |
| bufferValueType             | int                                                                                                            | No        | Override for deploymentRegion.bufferValueType. The bufferValue property must be interpreted as, 0: absolute value, 1: percentage value (must be accompanied by bufferValueMin and bufferValueMax). Null value means that the bufferValueType provided in the deploymentProfile will persist |
| bufferValueMin              | int                                                                                                            | No        | Override for deploymentRegion.bufferValueMin. The minimum absolute buffer value when using a percentage, to prevent bufferValue from going to low. Null value means that the bufferValueMin provided in the deploymentProfile will persist                                                  |
| bufferValueMax              | int                                                                                                            | No        | Override for deploymentRegion.bufferValueMax. The maximum absolute buffer value when using a percentage, to prevent bufferValue from going to high. Null value means that the bufferValueMax provided in the deploymentProfile will persist                                                 |
| strategyType                | int                                                                                                            | No        | Override value for DeploymentProfile.strategyType - 0: use default, 1: round robin. Null value means that the strategyType provided in the deploymentProfile will persist                                                                                                                   |
| markedForDeletion           | boolean                                                                                                        | Read-only | If set to true, we will gracefully remove all game servers and VMs in this deployment region. Afterwards this deployment region will be set to inactive                                                                                                                                     |
| containers                  | \[[DeploymentContainer](https://docs.i3d.net/game-hosting/elements/deploymentenvironment/deploymentcontainer)] | No        | Container that holds an array of DeploymentContainer elements, defining primary and secondary groups of cloud DC locations                                                                                                                                                                  |
| inUse                       | int                                                                                                            | Read-only | <p><strong>0</strong>: Deployment region has no active application instances<br><strong>1</strong>: Deployment region has active application instance(s)</p>                                                                                                                                |

Table 1: DeploymentRegion element structure

## API example

Create a new DeploymentRegion for a DeploymentProfile.

[Full API reference](https://docs.i3d.net/api/api_one#v3-deploymentregion-deploymentregionid)

#### HTTP request

[`POST /v3/deploymentProfile/{deploymentProfileId}/deploymentRegion`](https://docs.i3d.net/api/api_one#v3-deploymentprofile-deploymentprofileid-deploymentregion)

#### Request body

```
{
  "name": 0,
  "i3dDcLocationIds": [
    0
  ],
  "i3dDcLocationIdsToBeRemoved": [
    0
  ],
  "minimumCapacity": 0,
  "maximumCapacity": 0,
  "bufferValue": 0,
  "bufferValueType": 0,
  "bufferValueMin": 0,
  "bufferValueMax": 0,
  "strategyType": 0,
  "containers": [
    {
      "id": 0,
      "containerLocations": [
        {
          "id": 0,
          "cloudProviderId": 0,
          "dcLocationId": 0,
          "primaryInstanceTypeName": 0,
          "secondaryInstanceTypeName": 0,
          "cpuPlatform": 0
        }
      ]
    }
  ]
}
```

#### Response body

```
[
  {
    "id": 0,
    "name": 0,
    "i3dDcLocationIds": [
      0
    ],
    "i3dDcLocationIdsToBeRemoved": [
      0
    ],
    "minimumCapacity": 0,
    "maximumCapacity": 0,
    "bufferValue": 0,
    "bufferValueType": 0,
    "bufferValueMin": 0,
    "bufferValueMax": 0,
    "strategyType": 0,
    "markedForDeletion": 0,
    "containers": [
      {
        "id": 0,
        "markedForDeletion": 0,
        "containerLocations": [
          {
            "id": 0,
            "cloudProviderId": 0,
            "dcLocationId": 0,
            "primaryInstanceTypeName": 0,
            "secondaryInstanceTypeName": 0,
            "cpuPlatform": 0,
            "markedForDeletion": 0
          }
        ]
      }
    ]
  }
]
```
