> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/infra-controller/llms.txt.
> For full documentation content, see https://docs.nvidia.com/infra-controller/llms-full.txt.

# Update Machine

PATCH https://carbide-rest-api.carbide.svc.cluster.local/v2/org/{org}/carbide/machine/{machineId}
Content-Type: application/json

Update a Machine

Instance Type attribute updates, maintenance attribute updates and labels updates must be specified in separate requests. They cannot be processed at the same time.

Some attributes can only be updated by Provider, while others can be updated by Provider or a Privileged Tenant.


Reference: https://docs.nvidia.com/infra-controller/infra-controller/rest-api-reference/api-reference/machine/update-machine

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: NCX Infra Controller REST API
  version: 1.0.0
paths:
  /v2/org/{org}/carbide/machine/{machineId}:
    patch:
      operationId: update-machine
      summary: Update Machine
      description: >
        Update a Machine


        Instance Type attribute updates, maintenance attribute updates and
        labels updates must be specified in separate requests. They cannot be
        processed at the same time.


        Some attributes can only be updated by Provider, while others can be
        updated by Provider or a Privileged Tenant.
      tags:
        - subpackage_machine
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
        - name: machineId
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            ```

            export JWT_BEARER_TOKEN="<jwt-bearer-token>"


            # Example org name: "acme-inc

            export ORG_NAME=<org-name>


            # Use the JWT bearer token in your API request auth header:

            curl -v -X GET -H "Content-Type: application/json" -H
            "Authorization: Bearer $JWT_BEARER_TOKEN"
            https://carbide-rest-api.carbide.svc.cluster.local/v2/org/$ORG_NAME/carbide/user/current

            ```
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Machine'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MachineUpdateRequest'
servers:
  - url: https://carbide-rest-api.carbide.svc.cluster.local
components:
  schemas:
    Labels:
      type: object
      additionalProperties:
        type: string
      title: Labels
    MachineUpdateRequest:
      type: object
      properties:
        instanceTypeId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Update the Instance Type of the Machine. Cannot be specified when
            clearing Instance Type. Can only be updated by Provider.
        clearInstanceType:
          type:
            - boolean
            - 'null'
          description: >-
            Set to true to clear the existing Instance Type. Cannot be specified
            if Instance Type ID is specified. Can only be set by Provider.
        setMaintenanceMode:
          type:
            - boolean
            - 'null'
          description: >-
            Set to `true` to enable maintenance mode and to `false` to disable
            maintenance mode. Can be set by Provider or Privileged Tenant.
        maintenanceMessage:
          type:
            - string
            - 'null'
          description: >-
            Optional message describing the reason for moving Machine into
            maintenance mode. Can be updated by Provider or Privileged Tenant.
        labels:
          $ref: '#/components/schemas/Labels'
          description: >-
            Machine labels will be overwritten, include existing labels to
            preserve them. Can be updated by Provider or Privileged Tenant.
      description: >-
        Request data to update Machine. Instance Type attribute updates,
        maintenance attribute updates and labels updates must be specified in
        separate requests. They cannot be proceessed at the same time.
      title: MachineUpdateRequest
    MachineCapabilityType:
      type: string
      enum:
        - CPU
        - Memory
        - Storage
        - Network
        - GPU
        - InfiniBand
        - DPU
      description: Type of the Capability
      title: MachineCapabilityType
    MachineCapability:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/MachineCapabilityType'
          description: Type of the Capability
        name:
          type: string
          description: Name of the Capability component
        frequency:
          type:
            - string
            - 'null'
          description: Frequency of the Capability component, if available
        cores:
          type:
            - integer
            - 'null'
          description: Number of Cores in the Capability component, if applicable
        threads:
          type:
            - integer
            - 'null'
          description: Number of Threads in the Capability component, if applicable
        capacity:
          type:
            - string
            - 'null'
          description: Capacity of the Capability component, if applicable
        vendor:
          type:
            - string
            - 'null'
          description: Vendor of the Capability component, if available
        inactiveDevices:
          type: array
          items:
            type: integer
          description: A list of inactive devices
        count:
          type:
            - integer
            - 'null'
          description: Count of the Capability component
        deviceType:
          type:
            - string
            - 'null'
          description: Device Type of the Capability component, if available
      description: Describes capabilities of a Machine
      title: MachineCapability
    MachineInterface:
      type: object
      properties:
        id:
          type: string
          format: uuid
        machineId:
          type: string
        controllerInterfaceId:
          type: string
          format: uuid
        controllerSegmentId:
          type: string
          format: uuid
        attachedDpuMachineID:
          type:
            - string
            - 'null'
        subnetId:
          type:
            - string
            - 'null'
          format: uuid
        hostname:
          type: string
          format: hostname
        isPrimary:
          type: boolean
        macAddress:
          type: string
        ipAddresses:
          type: array
          items:
            type: string
          description: Array of IP addresses
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: Describes an interface attached to a machine
      title: MachineInterface
    MachineHealthProbeSuccess:
      type: object
      properties:
        id:
          type: string
          description: Health probe identifier
        target:
          type:
            - string
            - 'null'
          description: Specific component targeted by health probe
      description: Describes results of successful Machine health probe
      title: MachineHealthProbeSuccess
    MachineHealthProbeAlert:
      type: object
      properties:
        id:
          type: string
          description: Health probe identifier
        target:
          type:
            - string
            - 'null'
          description: Specific component targeted by health probe
        inAlertSince:
          type:
            - string
            - 'null'
          description: Date/time since the alert has been in effect
        message:
          type: string
          description: Details of the failed health probe result
        tenantMessage:
          type:
            - string
            - 'null'
          description: Information provided by Tenant, if any
        classifications:
          type: array
          items:
            type: string
          description: Classifications for this alert, category or impact
      description: Describes results of a failed Machine health probe
      title: MachineHealthProbeAlert
    MachineHealth:
      type: object
      properties:
        source:
          type: string
          description: Describes how the health report was generated
        observedAt:
          type:
            - string
            - 'null'
          description: Date/time when health report was generated
        successes:
          type: array
          items:
            $ref: '#/components/schemas/MachineHealthProbeSuccess'
          description: Results from successful health probes for the Machine
        alerts:
          type: array
          items:
            $ref: '#/components/schemas/MachineHealthProbeAlert'
          description: Results from failed health probes for the Machine
      description: Describes results of various Machine health probes and alerts
      title: MachineHealth
    MachineDMIData:
      type: object
      properties:
        boardName:
          type: string
        boardSerial:
          type: string
        boardVersion:
          type: string
        biosDate:
          type: string
        biosVersion:
          type: string
        productSerial:
          type: string
        chassisSerial:
          type: string
      description: Describes DMI data of a Machine
      title: MachineDMIData
    MachineBMCInfo:
      type: object
      properties:
        ip:
          type: string
          format: ipv4
        mac:
          type: string
        version:
          type: string
        firmwareRevision:
          type: string
      description: Describes BMC information of a Machine
      title: MachineBMCInfo
    MachineGPUInfo:
      type: object
      properties:
        name:
          type: string
        serial:
          type: string
        driverVersion:
          type: string
        vbiosVersion:
          type: string
        inforomVersion:
          type: string
        totalMemory:
          type: string
        frequency:
          type: string
        pciBusId:
          type: string
      description: Describes information about GPU of a Machine
      title: MachineGPUInfo
    MachineNetworkInterface:
      type: object
      properties:
        macAddress:
          type: string
        vendor:
          type: string
        device:
          type: string
        path:
          type: string
        numaNode:
          type: integer
        description:
          type: string
        slot:
          type: string
      description: Describes information about an Ethernet Interface of a Machine
      title: MachineNetworkInterface
    MachineInfiniBandInterface:
      type: object
      properties:
        guid:
          type: string
        vendor:
          type: string
        device:
          type: string
        path:
          type: string
        numaNode:
          type: integer
        description:
          type: string
        slot:
          type: string
      description: Describes information about an Infiniband Interface of a Machine
      title: MachineInfiniBandInterface
    MachineMetadata:
      type: object
      properties:
        dmiData:
          $ref: '#/components/schemas/MachineDMIData'
        bmcInfo:
          $ref: '#/components/schemas/MachineBMCInfo'
        gpus:
          type: array
          items:
            $ref: '#/components/schemas/MachineGPUInfo'
        networkInterfaces:
          type: array
          items:
            $ref: '#/components/schemas/MachineNetworkInterface'
        infinibandInterfaces:
          type: array
          items:
            $ref: '#/components/schemas/MachineInfiniBandInterface'
      description: Describes metadata for various Machine components
      title: MachineMetadata
    MachineStatus:
      type: string
      enum:
        - Initializing
        - Ready
        - Reset
        - Maintenance
        - InUse
        - Error
        - Decommissioned
        - Unknown
      description: Status values for Machine objects
      title: MachineStatus
    StatusDetail:
      type: object
      properties:
        status:
          type: string
        message:
          type: string
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: Describes the details of a status transition for a resource
      title: StatusDetail
    Machine:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of Machine
        infrastructureProviderId:
          type: string
          format: uuid
          description: ID of the Provider that owns the Machine
        siteId:
          type: string
          format: uuid
          description: ID of the Site the Machine belongs to
        instanceTypeId:
          type:
            - string
            - 'null'
          format: uuid
          description: ID of the Instance Type, if assigned
        instanceId:
          type:
            - string
            - 'null'
          format: uuid
          description: ID of the Instance if this Machine is assigned to one
        tenantId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            ID of the Tenant that owns the Instance if the Machine is assigned
            to one
        controllerMachineId:
          type: string
          description: ID of the Machine at Site, now same as the primary ID
        controllerMachineType:
          type: string
          description: Denotes architecture (x86 vs ARM) of the Machine
        hwSkuDeviceType:
          type:
            - string
            - 'null'
          description: >-
            SKU derived device type of the machine, e.g. cpu, gpu, cache,
            storage, etc.
        vendor:
          type: string
          description: Name of the vendor of the Machine
        productName:
          type: string
          description: Product name of the Machine
        serialNumber:
          type: string
          description: Serial number of the Machine, only visible to Provider
        machineCapabilities:
          type: array
          items:
            $ref: '#/components/schemas/MachineCapability'
        machineInterfaces:
          type: array
          items:
            $ref: '#/components/schemas/MachineInterface'
        maintenanceMessage:
          type:
            - string
            - 'null'
          description: >-
            If the Machine is in maintenance mode, this message will typically
            describe the reason and how long it is expected to be in maintenance
        health:
          $ref: '#/components/schemas/MachineHealth'
        metadata:
          $ref: '#/components/schemas/MachineMetadata'
          description: >-
            Only available to Providers. Returned if includeMetadata query param
            is specified. Otherwise attribute is omitted from response.
        labels:
          $ref: '#/components/schemas/Labels'
        status:
          $ref: '#/components/schemas/MachineStatus'
        isUsableByTenant:
          type: boolean
          description: >-
            Indicates whether the machine is usable by or currently in use by a
            tenant.
        statusHistory:
          type: array
          items:
            $ref: '#/components/schemas/StatusDetail'
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: Machine is the baremetal server that sits in the datacenter
      title: Machine
  securitySchemes:
    JWTBearerToken:
      type: http
      scheme: bearer
      description: >-
        ```

        export JWT_BEARER_TOKEN="<jwt-bearer-token>"


        # Example org name: "acme-inc

        export ORG_NAME=<org-name>


        # Use the JWT bearer token in your API request auth header:

        curl -v -X GET -H "Content-Type: application/json" -H "Authorization:
        Bearer $JWT_BEARER_TOKEN"
        https://carbide-rest-api.carbide.svc.cluster.local/v2/org/$ORG_NAME/carbide/user/current

        ```

```

## SDK Code Examples

```python Example 1
import requests

url = "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, headers=headers)

print(response.json())
```

```javascript Example 1
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example 1
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

	req, _ := http.NewRequest("PATCH", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example 1
require 'uri'
require 'net/http'

url = URI("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Example 1
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Example 1
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Example 1
using RestSharp;

var client = new RestClient("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Example 1
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Update Instance Type
import requests

url = "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

payload = { "instanceTypeId": "2e016c02-2c67-48aa-b289-5d3ca6320c52" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update Instance Type
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"instanceTypeId":"2e016c02-2c67-48aa-b289-5d3ca6320c52"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update Instance Type
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

	payload := strings.NewReader("{\n  \"instanceTypeId\": \"2e016c02-2c67-48aa-b289-5d3ca6320c52\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update Instance Type
require 'uri'
require 'net/http'

url = URI("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"instanceTypeId\": \"2e016c02-2c67-48aa-b289-5d3ca6320c52\"\n}"

response = http.request(request)
puts response.read_body
```

```java Update Instance Type
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"instanceTypeId\": \"2e016c02-2c67-48aa-b289-5d3ca6320c52\"\n}")
  .asString();
```

```php Update Instance Type
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId', [
  'body' => '{
  "instanceTypeId": "2e016c02-2c67-48aa-b289-5d3ca6320c52"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Update Instance Type
using RestSharp;

var client = new RestClient("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"instanceTypeId\": \"2e016c02-2c67-48aa-b289-5d3ca6320c52\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Instance Type
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["instanceTypeId": "2e016c02-2c67-48aa-b289-5d3ca6320c52"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Clear Instance Type
import requests

url = "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

payload = { "clearInstanceType": True }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Clear Instance Type
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"clearInstanceType":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Clear Instance Type
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

	payload := strings.NewReader("{\n  \"clearInstanceType\": true\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Clear Instance Type
require 'uri'
require 'net/http'

url = URI("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"clearInstanceType\": true\n}"

response = http.request(request)
puts response.read_body
```

```java Clear Instance Type
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"clearInstanceType\": true\n}")
  .asString();
```

```php Clear Instance Type
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId', [
  'body' => '{
  "clearInstanceType": true
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Clear Instance Type
using RestSharp;

var client = new RestClient("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"clearInstanceType\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Clear Instance Type
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["clearInstanceType": true] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Set Maintenance Message
import requests

url = "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

payload = {
    "setMaintenanceMode": True,
    "maintenanceMessage": "Machine requires re-cabling to connect with revised underlay network. Estimated maintenance time is 2 days"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Set Maintenance Message
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"setMaintenanceMode":true,"maintenanceMessage":"Machine requires re-cabling to connect with revised underlay network. Estimated maintenance time is 2 days"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Set Maintenance Message
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

	payload := strings.NewReader("{\n  \"setMaintenanceMode\": true,\n  \"maintenanceMessage\": \"Machine requires re-cabling to connect with revised underlay network. Estimated maintenance time is 2 days\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Set Maintenance Message
require 'uri'
require 'net/http'

url = URI("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"setMaintenanceMode\": true,\n  \"maintenanceMessage\": \"Machine requires re-cabling to connect with revised underlay network. Estimated maintenance time is 2 days\"\n}"

response = http.request(request)
puts response.read_body
```

```java Set Maintenance Message
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"setMaintenanceMode\": true,\n  \"maintenanceMessage\": \"Machine requires re-cabling to connect with revised underlay network. Estimated maintenance time is 2 days\"\n}")
  .asString();
```

```php Set Maintenance Message
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId', [
  'body' => '{
  "setMaintenanceMode": true,
  "maintenanceMessage": "Machine requires re-cabling to connect with revised underlay network. Estimated maintenance time is 2 days"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Set Maintenance Message
using RestSharp;

var client = new RestClient("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"setMaintenanceMode\": true,\n  \"maintenanceMessage\": \"Machine requires re-cabling to connect with revised underlay network. Estimated maintenance time is 2 days\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Set Maintenance Message
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "setMaintenanceMode": true,
  "maintenanceMessage": "Machine requires re-cabling to connect with revised underlay network. Estimated maintenance time is 2 days"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Remove Maintenance Message
import requests

url = "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

payload = { "setMaintenanceMode": False }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Remove Maintenance Message
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"setMaintenanceMode":false}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Remove Maintenance Message
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

	payload := strings.NewReader("{\n  \"setMaintenanceMode\": false\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Remove Maintenance Message
require 'uri'
require 'net/http'

url = URI("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"setMaintenanceMode\": false\n}"

response = http.request(request)
puts response.read_body
```

```java Remove Maintenance Message
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"setMaintenanceMode\": false\n}")
  .asString();
```

```php Remove Maintenance Message
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId', [
  'body' => '{
  "setMaintenanceMode": false
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Remove Maintenance Message
using RestSharp;

var client = new RestClient("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"setMaintenanceMode\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove Maintenance Message
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["setMaintenanceMode": false] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Update Labels
import requests

url = "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

payload = { "labels": {
        "RackIdentifier": "GVX11F01C02",
        "ServerName": "SITE1-C03-Server-02",
        "RepairStatus": "InProgress"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update Labels
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"labels":{"RackIdentifier":"GVX11F01C02","ServerName":"SITE1-C03-Server-02","RepairStatus":"InProgress"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update Labels
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

	payload := strings.NewReader("{\n  \"labels\": {\n    \"RackIdentifier\": \"GVX11F01C02\",\n    \"ServerName\": \"SITE1-C03-Server-02\",\n    \"RepairStatus\": \"InProgress\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update Labels
require 'uri'
require 'net/http'

url = URI("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"labels\": {\n    \"RackIdentifier\": \"GVX11F01C02\",\n    \"ServerName\": \"SITE1-C03-Server-02\",\n    \"RepairStatus\": \"InProgress\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Update Labels
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"labels\": {\n    \"RackIdentifier\": \"GVX11F01C02\",\n    \"ServerName\": \"SITE1-C03-Server-02\",\n    \"RepairStatus\": \"InProgress\"\n  }\n}")
  .asString();
```

```php Update Labels
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId', [
  'body' => '{
  "labels": {
    "RackIdentifier": "GVX11F01C02",
    "ServerName": "SITE1-C03-Server-02",
    "RepairStatus": "InProgress"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Update Labels
using RestSharp;

var client = new RestClient("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"labels\": {\n    \"RackIdentifier\": \"GVX11F01C02\",\n    \"ServerName\": \"SITE1-C03-Server-02\",\n    \"RepairStatus\": \"InProgress\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Labels
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["labels": [
    "RackIdentifier": "GVX11F01C02",
    "ServerName": "SITE1-C03-Server-02",
    "RepairStatus": "InProgress"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```