Labels · operationId:PutLabel

Update a Label

PUT /v1/functions/{functionId}/labels/{labelId}

Description

Update label

Path parameters

NameTypeRequiredDescription
functionId string yes

labelId string yes

Request body

Content type: application/json. Body schema: WritableLabel.

Responses

StatusDescriptionBody
200 Success Label

Code samples

curl
curl -X PUT \
  -H 'Authorization: Bearer <accessToken>' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "my-label",
  "description": "string",
  "metadata": {
  }
}' \
  'https://www.nyckel.com/v1/functions/<functionId>/labels/<labelId>'
Python
import requests

url = 'https://www.nyckel.com/v1/functions/<functionId>/labels/<labelId>'
headers = {
    'Authorization': 'Bearer <accessToken>',
    'Content-Type': 'application/json',
}

body = """{
  "name": "my-label",
  "description": "string",
  "metadata": {
  }
}"""
response = requests.put(url, headers=headers, data=body)
print(response.json())
JavaScript
fetch('https://www.nyckel.com/v1/functions/<functionId>/labels/<labelId>', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer <accessToken>',
    'Content-Type': 'application/json',
  },
  body: `{
  "name": "my-label",
  "description": "string",
  "metadata": {
  }
}`,
})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.nyckel.com/v1/functions/<functionId>/labels/<labelId>');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');

$headers = array(
    'Authorization: Bearer <accessToken>',
    'Content-Type: application/json',
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$body = <<<'NYCKEL_BODY'
{
  "name": "my-label",
  "description": "string",
  "metadata": {
  }
}
NYCKEL_BODY;
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

$response = curl_exec($ch);
curl_close($ch);
echo $response;