# Network › vRack Services › Services API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Network product's sections: https://developers.eu.ovhcloud.com/reference/network/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 3 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/network/vrack-services/services/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/network/vrack-services/services.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/network/vrack-services/services.json?format=openapi3

## Operations

- `GET /vrackServices/resource` — List vRack Services
- `GET /vrackServices/resource/{vrackServicesId}` — Get a vRack Services
- `PUT /vrackServices/resource/{vrackServicesId}` — Update a vRack Services

## List vRack Services

`GET /v2/vrackServices/resource`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack-services/services/#get-vrackservices-resource

**Status:** Stable production version  
**IAM actions:** `vrackServices:apiovh:resource/get`

Returns the vRack Services of the account, each with its requested and current configuration.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `iamTags` | query | object |  | Filter resources on IAM tags |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vrackServices.VrackServicesWithIAM[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
| `createdAt` | string (date-time) | read-only | Date of the vRack Services delivery |
| `currentState` | vrackServices.VrackServicesCurrentState | read-only | Current configuration applied to the vRack Services |
| `currentState.bgp` | vrackServices.Bgp | read-only | BGP configuration of the vRack Services |
| `currentState.bgp.allowedPrefixes` | vrackServices.AllowedPrefixes | read-only | List of allowed prefixes, OVH public IP blocks |
| `currentState.bgp.bandwidth` | integer | read-only | BGP bandwidth in Mbps, direct: INGRESS |
| `currentState.bgp.bgpRange` | vrackServices.BgpRange[] | read-only | BGP ranges |
| `currentState.bgp.clientAsn` | integer | read-only | Client ASN |
| `currentState.bgp.configurationStatus` | vrackServices.BgpConfigurationStatus | read-only | BGP configuration status |
| `currentState.bgp.iam` | iam.ResourceMetadata | read-only | IAM resource metadata of the BGP configuration |
| `currentState.bgp.id` | string | read-only | Identifier of the BGP |
| `currentState.bgp.infrastructureAsn` | integer | read-only | Infrastructure ASN |
| `currentState.configurationStatus` | vrackServices.VrackServicesConfigurationStatus | read-only | vRack Services configuration status |
| `currentState.configurationStatus.reason` | vrackServices.VrackServicesConfigurationStatusReasonEnum | read-only | Reason for the status. Omitted when status is READY. — one of `MISSING_VRACK_ASSOCIATION` |
| `currentState.configurationStatus.status` | vrackServices.VrackServicesConfigurationStatusEnum | read-only | Configuration status — one of `DRAFT`, `READY`, `SUSPENDED` |
| `currentState.region` | string | read-only | Region of the vRack Services. List of compatible regions can be retrieved from /reference/region. |
| `currentState.services` | vrackServices.ServicesCurrentState | read-only | Services current state |
| `currentState.services.serviceRange` | vrackServices.ServiceRangeCurrentState[] | read-only | Service ranges |
| `currentState.subnets` | vrackServices.Subnet[] | read-only | Subnets of the current vRack Services |
| `currentState.subnets[].az` | string | read-only | Availability zone |
| `currentState.subnets[].cidr` | ipBlock | read-only | IP address range of the subnet in CIDR format |
| `currentState.subnets[].displayName` | string | read-only | Display name of the subnet |
| `currentState.subnets[].vlan` | integer | read-only | Unique inner VLAN that allows subnets segregation |
| `currentState.vrackId` | string | read-only | vRack associated to the vRack Services |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the vRack Services |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `id` | string | read-only | Unique identifier |
| `resourceStatus` | vrackServices.ResourceStatusEnum | read-only | Reflects the readiness of the vRack Services. A new target specification request will be accepted only in `READY` status. — one of `CREATING`, `DELETING`, `ERROR`, `READY`, `UPDATING` |
| `targetSpec` | vrackServices.VrackServicesTargetSpec | read-only | Last target specification of the vRack Services |
| `targetSpec.bgp` | vrackServices.BgpTargetSpec |  | Target specification of the BGP configuration |
| `targetSpec.bgp.allowedPrefixes` | vrackServices.AllowedPrefixes |  | List of allowed prefixes, OVH public IP blocks |
| `targetSpec.bgp.bgpRange` | vrackServices.BgpRangeTargetSpec[] |  | BGP ranges |
| `targetSpec.bgp.clientAsn` | integer |  | Private client ASN. Authorized values: [64512 - 65533]. Defaults to 64512. |
| `targetSpec.bgp.infrastructureAsn` | integer |  | Private infrastructure ASN. Authorized values: [64513-65534]. Defaults to 65534. |
| `targetSpec.services` | vrackServices.ServicesTarget |  | Target specification of the services |
| `targetSpec.services.serviceRange` | vrackServices.ServiceRangeTarget[] | yes | Service range target specifications |
| `targetSpec.subnets` | vrackServices.TargetSubnet[] | yes | Target specification of the subnets. At most 3 subnets per vRack Services. |
| `targetSpec.subnets[].az` | string | yes | Availability zone of the subnet, one of the vRack Services region zones (`<region>-a` today). Immutable once the subnet exists: a change is ignored, delete and recreate the subnet instead. |
| `targetSpec.subnets[].cidr` | ipBlock | yes | IP address range of the subnet in CIDR format. Must be a private network address (RFC 1918 for IPv4, RFC 4193 for IPv6). Authorized prefix length: /23 to /24 for IPv4, /64 for IPv6. |
| `targetSpec.subnets[].displayName` | string |  | Display name of the subnet. Format must follow `^[ a-zA-Z0-9-_.]{0,40}$`. |
| `targetSpec.subnets[].vlan` | integer |  | Unique inner VLAN that allows subnets segregation. Authorized values: [2 - 4094] and `null` (untagged traffic). Must be `null` for an IPv6 subnet, and when the subnet is referenced by a BGP range (see `bgp.bgpRange[].subnetCidr`). Only one untagged subnet is allowed per IP version and per availability zone. |
| `updatedAt` | string (date-time) | read-only | Date of the Last vRack Services update |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "bgp": {
        "allowedPrefixes": {
          "ipv4": [
            "192.0.2.0/24"
          ],
          "ipv6": [
            "2001:41d0::/128"
          ]
        },
        "bandwidth": 0,
        "bgpRange": [
          {
            "cidr": "192.0.2.0/24",
            "clientPeers": [
              null
            ],
            "infrastructurePeers": [
              null
            ],
            "subnetCidr": "192.0.2.0/24"
          }
        ],
        "clientAsn": 0,
        "configurationStatus": {
          "reason": "MISSING_ALLOWED_PREFIX",
          "status": "DRAFT"
        },
        "iam": {
          "displayName": "string",
          "id": "00000000-0000-0000-0000-000000000000",
          "state": "EXPIRED",
          "tags": {
            "key": "string"
          },
          "urn": "string"
        },
        "id": "string",
        "infrastructureAsn": 0
      },
      "configurationStatus": {
        "reason": "MISSING_VRACK_ASSOCIATION",
        "status": "DRAFT"
      },
      "region": "string",
      "services": {
        "serviceRange": [
          {
            "cidr": "192.0.2.0/24",
            "remainingIps": 0,
            "reservedIps": 0,
            "serviceEndpoints": [
              null
            ],
            "serviceEndpointsConfigurationStatus": {
              "reason": null,
              "status": null
            },
            "subnetCidr": "192.0.2.0/24",
            "usedIps": 0
          }
        ]
      },
  …
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/vrackServices/resource" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/vrackServices/resource")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/vrackServices/resource");

print_r($result);
?>
```

## Get a vRack Services

`GET /v2/vrackServices/resource/{vrackServicesId}`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack-services/services/#get-vrackservices-resource-vrackservicesid

**Status:** Stable production version  
**IAM actions:** `vrackServices:apiovh:resource/get`

Returns the requested and current configuration of the vRack Services: region, associated vRack, subnets with their Service Endpoints, status and running tasks.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `vrackServicesId` | path | string | yes | Vrack services ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vrackServices.VrackServicesWithIAM | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
| `createdAt` | string (date-time) | read-only | Date of the vRack Services delivery |
| `currentState` | vrackServices.VrackServicesCurrentState | read-only | Current configuration applied to the vRack Services |
| `currentState.bgp` | vrackServices.Bgp | read-only | BGP configuration of the vRack Services |
| `currentState.bgp.allowedPrefixes` | vrackServices.AllowedPrefixes | read-only | List of allowed prefixes, OVH public IP blocks |
| `currentState.bgp.bandwidth` | integer | read-only | BGP bandwidth in Mbps, direct: INGRESS |
| `currentState.bgp.bgpRange` | vrackServices.BgpRange[] | read-only | BGP ranges |
| `currentState.bgp.clientAsn` | integer | read-only | Client ASN |
| `currentState.bgp.configurationStatus` | vrackServices.BgpConfigurationStatus | read-only | BGP configuration status |
| `currentState.bgp.iam` | iam.ResourceMetadata | read-only | IAM resource metadata of the BGP configuration |
| `currentState.bgp.id` | string | read-only | Identifier of the BGP |
| `currentState.bgp.infrastructureAsn` | integer | read-only | Infrastructure ASN |
| `currentState.configurationStatus` | vrackServices.VrackServicesConfigurationStatus | read-only | vRack Services configuration status |
| `currentState.configurationStatus.reason` | vrackServices.VrackServicesConfigurationStatusReasonEnum | read-only | Reason for the status. Omitted when status is READY. — one of `MISSING_VRACK_ASSOCIATION` |
| `currentState.configurationStatus.status` | vrackServices.VrackServicesConfigurationStatusEnum | read-only | Configuration status — one of `DRAFT`, `READY`, `SUSPENDED` |
| `currentState.region` | string | read-only | Region of the vRack Services. List of compatible regions can be retrieved from /reference/region. |
| `currentState.services` | vrackServices.ServicesCurrentState | read-only | Services current state |
| `currentState.services.serviceRange` | vrackServices.ServiceRangeCurrentState[] | read-only | Service ranges |
| `currentState.subnets` | vrackServices.Subnet[] | read-only | Subnets of the current vRack Services |
| `currentState.subnets[].az` | string | read-only | Availability zone |
| `currentState.subnets[].cidr` | ipBlock | read-only | IP address range of the subnet in CIDR format |
| `currentState.subnets[].displayName` | string | read-only | Display name of the subnet |
| `currentState.subnets[].vlan` | integer | read-only | Unique inner VLAN that allows subnets segregation |
| `currentState.vrackId` | string | read-only | vRack associated to the vRack Services |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the vRack Services |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `id` | string | read-only | Unique identifier |
| `resourceStatus` | vrackServices.ResourceStatusEnum | read-only | Reflects the readiness of the vRack Services. A new target specification request will be accepted only in `READY` status. — one of `CREATING`, `DELETING`, `ERROR`, `READY`, `UPDATING` |
| `targetSpec` | vrackServices.VrackServicesTargetSpec | read-only | Last target specification of the vRack Services |
| `targetSpec.bgp` | vrackServices.BgpTargetSpec |  | Target specification of the BGP configuration |
| `targetSpec.bgp.allowedPrefixes` | vrackServices.AllowedPrefixes |  | List of allowed prefixes, OVH public IP blocks |
| `targetSpec.bgp.bgpRange` | vrackServices.BgpRangeTargetSpec[] |  | BGP ranges |
| `targetSpec.bgp.clientAsn` | integer |  | Private client ASN. Authorized values: [64512 - 65533]. Defaults to 64512. |
| `targetSpec.bgp.infrastructureAsn` | integer |  | Private infrastructure ASN. Authorized values: [64513-65534]. Defaults to 65534. |
| `targetSpec.services` | vrackServices.ServicesTarget |  | Target specification of the services |
| `targetSpec.services.serviceRange` | vrackServices.ServiceRangeTarget[] | yes | Service range target specifications |
| `targetSpec.subnets` | vrackServices.TargetSubnet[] | yes | Target specification of the subnets. At most 3 subnets per vRack Services. |
| `targetSpec.subnets[].az` | string | yes | Availability zone of the subnet, one of the vRack Services region zones (`<region>-a` today). Immutable once the subnet exists: a change is ignored, delete and recreate the subnet instead. |
| `targetSpec.subnets[].cidr` | ipBlock | yes | IP address range of the subnet in CIDR format. Must be a private network address (RFC 1918 for IPv4, RFC 4193 for IPv6). Authorized prefix length: /23 to /24 for IPv4, /64 for IPv6. |
| `targetSpec.subnets[].displayName` | string |  | Display name of the subnet. Format must follow `^[ a-zA-Z0-9-_.]{0,40}$`. |
| `targetSpec.subnets[].vlan` | integer |  | Unique inner VLAN that allows subnets segregation. Authorized values: [2 - 4094] and `null` (untagged traffic). Must be `null` for an IPv6 subnet, and when the subnet is referenced by a BGP range (see `bgp.bgpRange[].subnetCidr`). Only one untagged subnet is allowed per IP version and per availability zone. |
| `updatedAt` | string (date-time) | read-only | Date of the Last vRack Services update |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "bgp": {
      "allowedPrefixes": {
        "ipv4": [
          "192.0.2.0/24"
        ],
        "ipv6": [
          "2001:41d0::/128"
        ]
      },
      "bandwidth": 0,
      "bgpRange": [
        {
          "cidr": "192.0.2.0/24",
          "clientPeers": [
            "192.0.2.0"
          ],
          "infrastructurePeers": [
            "192.0.2.0"
          ],
          "subnetCidr": "192.0.2.0/24"
        }
      ],
      "clientAsn": 0,
      "configurationStatus": {
        "reason": "MISSING_ALLOWED_PREFIX",
        "status": "DRAFT"
      },
      "iam": {
        "displayName": "string",
        "id": "00000000-0000-0000-0000-000000000000",
        "state": "EXPIRED",
        "tags": {
          "key": "string"
        },
        "urn": "string"
      },
      "id": "string",
      "infrastructureAsn": 0
    },
    "configurationStatus": {
      "reason": "MISSING_VRACK_ASSOCIATION",
      "status": "DRAFT"
    },
    "region": "string",
    "services": {
      "serviceRange": [
        {
          "cidr": "192.0.2.0/24",
          "remainingIps": 0,
          "reservedIps": 0,
          "serviceEndpoints": [
            {
              "endpoints": null,
              "managedServiceURN": null
            }
          ],
          "serviceEndpointsConfigurationStatus": {
            "reason": "string",
            "status": "DRAFT"
          },
          "subnetCidr": "192.0.2.0/24",
          "usedIps": 0
        }
      ]
    },
    "subnets": [
      {
  …
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/vrackServices/resource/{vrackServicesId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/vrackServices/resource/{vrackServicesId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/vrackServices/resource/{vrackServicesId}");

print_r($result);
?>
```

## Update a vRack Services

`PUT /v2/vrackServices/resource/{vrackServicesId}`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack-services/services/#put-vrackservices-resource-vrackservicesid

**Status:** Stable production version  
**IAM actions:** `vrackServices:apiovh:resource/edit`, `vrackServices:apiovh:storageNetApp/attach`, `vrackServices:apiovh:storageNetApp/detach`, `storageNetApp:apiovh:vrackServices/attach`, `vrackServices:apiovh:nasHA/attach`, `vrackServices:apiovh:nasHA/detach`, `nasHA:apiovh:vrackServices/attach`, `vrackServices:apiovh:bgp/ip/additionalIp/move`, `ip:apiovh:move`

Replaces the target specification of the vRack Services, subnets and Service Endpoints, and applies it asynchronously.

It is the unique route handling any update on the vRack Services configuration. It works as following:
1. You define a new target specification in the request payload,
2. If this specification is validated, you get the resource with updated `targetSpec` and `checksum` values in return,
3. The request is processed by one or several asynchronous tasks that aims to reconciliate the `currentState` with the `targetSpec`

### Asynchronous processing
* To follow this processing, the VrackServices resource can be polled with `GET /vrackServices/resource/{vrackServicesId}`<br>As soon as its `resourceStatus` is *READY*, the requested specification can be considered as applied to the vRack Services.
* The `checksum` helps on detecting concurrency cases on update requests. If the polled `checksum` value differs from the one returned in response of your initial request, it means that processing of your request is completed and another request is being processed.
* In case of processing error (that is `resourceStatus` in *ERROR*), the current vRack Services configuration is still active, but modification requests will be refused until the intervention of the support.
* An overview on the asynchronous task(s) is available via the `currentTasks` attribute.<br>More details on a task are provided by the route `GET /vrackServices/resource/{vrackServicesId}/task/{taskId}`

### Seamless configuration actions
The request can combine any of the following seamless actions (meaning there won't be any cut of the service while updating):
* create a Subnet
* delete a Subnet without any Service Endpoint
* update a Subnet:
  * create one or several Service Endpoints

Note that a Subnet with several Service Endpoints can be created in the same payload

### Not seamless configuration actions
The modification of the Subnet characteristics listed below will result in a service cut while processing the update as they are interpreted as the deletion of the existing Subnet and creation of a new Subnet with provided characteristics. The IPs that were given to the Managed Services will be reelected and may as a result change:
* modifications on the Subnet `ServiceRange`
* modifications on the Subnet `Vlan`
* modifications on the Subnet `CIDR` 

The embedded Service Endpoints will be also deleted and re-created which implies a flapping accessibility in the vRack for every related managed services.  
Note that deleting a Subnet will also delete embedded Service Endpoints

The `vrackId` is a read-only attribute as the association vRack/vRackServices is handled by the [vRack API](console-preview/?section=%2Fvrack&branch=v1)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `vrackServicesId` | path | string | yes | Vrack services ID |

### Request body (required)

Type: `vrackServices.VrackServicesInput`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | yes | Computed hash used to control concurrent modification requests. Here, it represents the target specification value the request is based on. |
| `targetSpec` | vrackServices.VrackServicesTargetSpec | yes | Requested target specification |
| `targetSpec.bgp` | vrackServices.BgpTargetSpec |  | Target specification of the BGP configuration |
| `targetSpec.bgp.allowedPrefixes` | vrackServices.AllowedPrefixes |  | List of allowed prefixes, OVH public IP blocks |
| `targetSpec.bgp.bgpRange` | vrackServices.BgpRangeTargetSpec[] |  | BGP ranges |
| `targetSpec.bgp.clientAsn` | integer |  | Private client ASN. Authorized values: [64512 - 65533]. Defaults to 64512. |
| `targetSpec.bgp.infrastructureAsn` | integer |  | Private infrastructure ASN. Authorized values: [64513-65534]. Defaults to 65534. |
| `targetSpec.services` | vrackServices.ServicesTarget |  | Target specification of the services |
| `targetSpec.services.serviceRange` | vrackServices.ServiceRangeTarget[] | yes | Service range target specifications |
| `targetSpec.subnets` | vrackServices.TargetSubnet[] | yes | Target specification of the subnets. At most 3 subnets per vRack Services. |
| `targetSpec.subnets[].az` | string | yes | Availability zone of the subnet, one of the vRack Services region zones (`<region>-a` today). Immutable once the subnet exists: a change is ignored, delete and recreate the subnet instead. |
| `targetSpec.subnets[].cidr` | ipBlock | yes | IP address range of the subnet in CIDR format. Must be a private network address (RFC 1918 for IPv4, RFC 4193 for IPv6). Authorized prefix length: /23 to /24 for IPv4, /64 for IPv6. |
| `targetSpec.subnets[].displayName` | string |  | Display name of the subnet. Format must follow `^[ a-zA-Z0-9-_.]{0,40}$`. |
| `targetSpec.subnets[].vlan` | integer |  | Unique inner VLAN that allows subnets segregation. Authorized values: [2 - 4094] and `null` (untagged traffic). Must be `null` for an IPv6 subnet, and when the subnet is referenced by a BGP range (see `bgp.bgpRange[].subnetCidr`). Only one untagged subnet is allowed per IP version and per availability zone. |

```json
{
  "checksum": "string",
  "targetSpec": {
    "bgp": {
      "allowedPrefixes": {
        "ipv4": [
          "192.0.2.0/24"
        ],
        "ipv6": [
          "2001:41d0::/128"
        ]
      },
      "bgpRange": [
        {
          "cidr": "192.0.2.0/24",
          "clientPeers": [
            "192.0.2.0"
          ],
          "infrastructurePeers": [
            "192.0.2.0"
          ],
          "subnetCidr": "192.0.2.0/24"
        }
      ],
      "clientAsn": 0,
      "infrastructureAsn": 0
    },
    "services": {
      "serviceRange": [
        {
          "cidr": "192.0.2.0/24",
          "serviceEndpoints": [
            {
              "managedServiceURN": null
            }
          ],
          "subnetCidr": "192.0.2.0/24"
        }
      ]
    },
    "subnets": [
      {
        "az": "string",
        "cidr": "192.0.2.0/24",
        "displayName": "string",
        "vlan": 0
      }
    ]
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vrackServices.VrackServices | successful operation |
| 400 | object | Error 400 response |
| 404 | object | Error 404 response |
| 412 | object | Error 412 response |
| 423 | object | Error 423 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash used to control concurrent modification requests. Here, it represents the current target specification value. |
| `createdAt` | string (date-time) | read-only | Date of the vRack Services delivery |
| `currentState` | vrackServices.VrackServicesCurrentState | read-only | Current configuration applied to the vRack Services |
| `currentState.bgp` | vrackServices.Bgp | read-only | BGP configuration of the vRack Services |
| `currentState.bgp.allowedPrefixes` | vrackServices.AllowedPrefixes | read-only | List of allowed prefixes, OVH public IP blocks |
| `currentState.bgp.bandwidth` | integer | read-only | BGP bandwidth in Mbps, direct: INGRESS |
| `currentState.bgp.bgpRange` | vrackServices.BgpRange[] | read-only | BGP ranges |
| `currentState.bgp.clientAsn` | integer | read-only | Client ASN |
| `currentState.bgp.configurationStatus` | vrackServices.BgpConfigurationStatus | read-only | BGP configuration status |
| `currentState.bgp.iam` | iam.ResourceMetadata | read-only | IAM resource metadata of the BGP configuration |
| `currentState.bgp.id` | string | read-only | Identifier of the BGP |
| `currentState.bgp.infrastructureAsn` | integer | read-only | Infrastructure ASN |
| `currentState.configurationStatus` | vrackServices.VrackServicesConfigurationStatus | read-only | vRack Services configuration status |
| `currentState.configurationStatus.reason` | vrackServices.VrackServicesConfigurationStatusReasonEnum | read-only | Reason for the status. Omitted when status is READY. — one of `MISSING_VRACK_ASSOCIATION` |
| `currentState.configurationStatus.status` | vrackServices.VrackServicesConfigurationStatusEnum | read-only | Configuration status — one of `DRAFT`, `READY`, `SUSPENDED` |
| `currentState.region` | string | read-only | Region of the vRack Services. List of compatible regions can be retrieved from /reference/region. |
| `currentState.services` | vrackServices.ServicesCurrentState | read-only | Services current state |
| `currentState.services.serviceRange` | vrackServices.ServiceRangeCurrentState[] | read-only | Service ranges |
| `currentState.subnets` | vrackServices.Subnet[] | read-only | Subnets of the current vRack Services |
| `currentState.subnets[].az` | string | read-only | Availability zone |
| `currentState.subnets[].cidr` | ipBlock | read-only | IP address range of the subnet in CIDR format |
| `currentState.subnets[].displayName` | string | read-only | Display name of the subnet |
| `currentState.subnets[].vlan` | integer | read-only | Unique inner VLAN that allows subnets segregation |
| `currentState.vrackId` | string | read-only | vRack associated to the vRack Services |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations ongoing on the vRack Services |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string | read-only | Unique identifier |
| `resourceStatus` | vrackServices.ResourceStatusEnum | read-only | Reflects the readiness of the vRack Services. A new target specification request will be accepted only in `READY` status. — one of `CREATING`, `DELETING`, `ERROR`, `READY`, `UPDATING` |
| `targetSpec` | vrackServices.VrackServicesTargetSpec | read-only | Last target specification of the vRack Services |
| `targetSpec.bgp` | vrackServices.BgpTargetSpec |  | Target specification of the BGP configuration |
| `targetSpec.bgp.allowedPrefixes` | vrackServices.AllowedPrefixes |  | List of allowed prefixes, OVH public IP blocks |
| `targetSpec.bgp.bgpRange` | vrackServices.BgpRangeTargetSpec[] |  | BGP ranges |
| `targetSpec.bgp.clientAsn` | integer |  | Private client ASN. Authorized values: [64512 - 65533]. Defaults to 64512. |
| `targetSpec.bgp.infrastructureAsn` | integer |  | Private infrastructure ASN. Authorized values: [64513-65534]. Defaults to 65534. |
| `targetSpec.services` | vrackServices.ServicesTarget |  | Target specification of the services |
| `targetSpec.services.serviceRange` | vrackServices.ServiceRangeTarget[] | yes | Service range target specifications |
| `targetSpec.subnets` | vrackServices.TargetSubnet[] | yes | Target specification of the subnets. At most 3 subnets per vRack Services. |
| `targetSpec.subnets[].az` | string | yes | Availability zone of the subnet, one of the vRack Services region zones (`<region>-a` today). Immutable once the subnet exists: a change is ignored, delete and recreate the subnet instead. |
| `targetSpec.subnets[].cidr` | ipBlock | yes | IP address range of the subnet in CIDR format. Must be a private network address (RFC 1918 for IPv4, RFC 4193 for IPv6). Authorized prefix length: /23 to /24 for IPv4, /64 for IPv6. |
| `targetSpec.subnets[].displayName` | string |  | Display name of the subnet. Format must follow `^[ a-zA-Z0-9-_.]{0,40}$`. |
| `targetSpec.subnets[].vlan` | integer |  | Unique inner VLAN that allows subnets segregation. Authorized values: [2 - 4094] and `null` (untagged traffic). Must be `null` for an IPv6 subnet, and when the subnet is referenced by a BGP range (see `bgp.bgpRange[].subnetCidr`). Only one untagged subnet is allowed per IP version and per availability zone. |
| `updatedAt` | string (date-time) | read-only | Date of the Last vRack Services update |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "bgp": {
      "allowedPrefixes": {
        "ipv4": [
          "192.0.2.0/24"
        ],
        "ipv6": [
          "2001:41d0::/128"
        ]
      },
      "bandwidth": 0,
      "bgpRange": [
        {
          "cidr": "192.0.2.0/24",
          "clientPeers": [
            "192.0.2.0"
          ],
          "infrastructurePeers": [
            "192.0.2.0"
          ],
          "subnetCidr": "192.0.2.0/24"
        }
      ],
      "clientAsn": 0,
      "configurationStatus": {
        "reason": "MISSING_ALLOWED_PREFIX",
        "status": "DRAFT"
      },
      "iam": {
        "displayName": "string",
        "id": "00000000-0000-0000-0000-000000000000",
        "state": "EXPIRED",
        "tags": {
          "key": "string"
        },
        "urn": "string"
      },
      "id": "string",
      "infrastructureAsn": 0
    },
    "configurationStatus": {
      "reason": "MISSING_VRACK_ASSOCIATION",
      "status": "DRAFT"
    },
    "region": "string",
    "services": {
      "serviceRange": [
        {
          "cidr": "192.0.2.0/24",
          "remainingIps": 0,
          "reservedIps": 0,
          "serviceEndpoints": [
            {
              "endpoints": null,
              "managedServiceURN": null
            }
          ],
          "serviceEndpointsConfigurationStatus": {
            "reason": "string",
            "status": "DRAFT"
          },
          "subnetCidr": "192.0.2.0/24",
          "usedIps": 0
        }
      ]
    },
    "subnets": [
      {
  …
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/vrackServices/resource/{vrackServicesId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: vrackServices.VrackServicesInput
result = client.put("/v2/vrackServices/resource/{vrackServicesId}",
	checksum = None, # Computed hash used to control concurrent modification requests. Here, it represents the target specification value the request is based on. (type: string)
	targetSpec = None, # Requested target specification (type: vrackServices.VrackServicesTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: vrackServices.VrackServicesInput
$result = $ovh->put("/v2/vrackServices/resource/{vrackServicesId}", array(
	checksum => null, // Computed hash used to control concurrent modification requests. Here, it represents the target specification value the request is based on. (type: string)
	targetSpec => null, // Requested target specification (type: vrackServices.VrackServicesTargetSpec)
));

print_r($result);
?>
```
