diff --git a/config/_default/menus/api.en.yaml b/config/_default/menus/api.en.yaml index a345a9b538869..3c1d0b8fc5486 100644 --- a/config/_default/menus/api.en.yaml +++ b/config/_default/menus/api.en.yaml @@ -3648,6 +3648,18 @@ menu: url: /api/latest/synthetics/ identifier: synthetics generated: true + - name: Patch a global variable + url: '#patch-a-global-variable' + identifier: synthetics-patch-a-global-variable + parent: synthetics + generated: true + params: + versions: + - v2 + operationids: + - PatchGlobalVariable + unstable: [] + order: 20 - name: Save new value for on-demand concurrency cap url: '#save-new-value-for-on-demand-concurrency-cap' identifier: synthetics-save-new-value-for-on-demand-concurrency-cap diff --git a/content/en/api/v2/synthetics/examples.json b/content/en/api/v2/synthetics/examples.json index c8f7dab8faac4..b87ecbe06e8e6 100644 --- a/content/en/api/v2/synthetics/examples.json +++ b/content/en/api/v2/synthetics/examples.json @@ -56,5 +56,107 @@ }, "html": "
\n
\n
\n
\n

on_demand_concurrency_cap

\n
\n

double

\n

Value of the on-demand concurrency cap.

\n
\n \n
\n
" } + }, + "PatchGlobalVariable": { + "responses": { + "200": { + "json": { + "data": { + "attributes": { + "attributes": { + "restricted_roles": [ + "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + ] + }, + "description": "Example description", + "id": "string", + "is_fido": false, + "is_totp": false, + "name": "MY_VARIABLE", + "parse_test_options": { + "field": "content-type", + "localVariableName": "LOCAL_VARIABLE", + "parser": { + "type": "raw", + "value": "string" + }, + "type": "http_body" + }, + "parse_test_public_id": "abc-def-123", + "tags": [ + "team:front", + "test:workflow-1" + ], + "value": { + "options": { + "totp_parameters": { + "digits": 6, + "refresh_interval": 30 + } + }, + "secure": false, + "value": "example-value" + } + }, + "id": "string", + "type": "string" + } + }, + "html": "
\n
\n
\n
\n

data

\n
\n

object

\n

Synthetics global variable data. Wrapper around the global variable object.

\n
\n
\n
\n
\n
\n

attributes

\n
\n

object

\n

Synthetic global variable.

\n
\n
\n
\n
\n
\n

attributes

\n
\n

object

\n

Attributes of the global variable.

\n
\n
\n
\n
\n
\n

restricted_roles

\n
\n

[string]

\n

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

\n
\n \n
\n
\n
\n
\n
\n
\n
\n

description [required]

\n
\n

string

\n

Description of the global variable.

\n
\n \n
\n
\n
\n
\n
\n

id

\n
\n

string

\n

Unique identifier of the global variable.

\n
\n \n
\n
\n
\n
\n
\n

is_fido

\n
\n

boolean

\n

Determines if the global variable is a FIDO variable.

\n
\n \n
\n
\n
\n
\n
\n

is_totp

\n
\n

boolean

\n

Determines if the global variable is a TOTP/MFA variable.

\n
\n \n
\n
\n
\n
\n
\n

name [required]

\n
\n

string

\n

Name of the global variable. Unique across Synthetic global variables.

\n
\n \n
\n
\n
\n
\n
\n

parse_test_options

\n
\n

object

\n

Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with parse_test_public_id.

\n
\n
\n
\n
\n
\n

field

\n
\n

string

\n

When type is http_header, name of the header to use to extract the value.

\n
\n \n
\n
\n
\n
\n
\n

localVariableName

\n
\n

string

\n

When type is local_variable, name of the local variable to use to extract the value.

\n
\n \n
\n
\n
\n
\n
\n

parser

\n
\n

object

\n

Details of the parser to use for the global variable.

\n
\n
\n
\n
\n
\n

type [required]

\n
\n

enum

\n

Type of parser for a Synthetic global variable from a synthetics test. \nAllowed enum values: raw,json_path,regex,x_path

\n
\n \n
\n
\n
\n
\n
\n

value

\n
\n

string

\n

Regex or JSON path used for the parser. Not used with type raw.

\n
\n \n
\n
\n
\n
\n
\n
\n
\n

type [required]

\n
\n

enum

\n

Type of value to extract from a test for a Synthetic global variable. \nAllowed enum values: http_body,http_header,http_status_code,local_variable

\n
\n \n
\n
\n
\n
\n
\n
\n
\n

parse_test_public_id

\n
\n

string

\n

A Synthetic test ID to use as a test to generate the variable value.

\n
\n \n
\n
\n
\n
\n
\n

tags [required]

\n
\n

[string]

\n

Tags of the global variable.

\n
\n \n
\n
\n
\n
\n
\n

value [required]

\n
\n

object

\n

Value of the global variable.

\n
\n
\n
\n
\n
\n

options

\n
\n

object

\n

Options for the Global Variable for MFA.

\n
\n
\n
\n
\n
\n

totp_parameters

\n
\n

object

\n

Parameters for the TOTP/MFA variable

\n
\n
\n
\n
\n
\n

digits

\n
\n

int32

\n

Number of digits for the OTP code.

\n
\n \n
\n
\n
\n
\n
\n

refresh_interval

\n
\n

int32

\n

Interval for which to refresh the token (in seconds).

\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n

secure

\n
\n

boolean

\n

Determines if the value of the variable is hidden.

\n
\n \n
\n
\n
\n
\n
\n

value

\n
\n

string

\n

Value of the global variable. When reading a global variable,\nthe value will not be present if the variable is hidden with the secure property.

\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n

id

\n
\n

string

\n

Global variable identifier.

\n
\n \n
\n
\n
\n
\n
\n

type

\n
\n

enum

\n

Global variable type. \nAllowed enum values: global_variables

\n
\n \n
\n
\n
\n
" + }, + "400": { + "json": { + "errors": [ + "Bad Request" + ] + }, + "html": "
\n
\n
\n
\n

errors [required]

\n
\n

[string]

\n

A list of errors.

\n
\n \n
\n
" + }, + "404": { + "json": { + "errors": [ + "Bad Request" + ] + }, + "html": "
\n
\n
\n
\n

errors [required]

\n
\n

[string]

\n

A list of errors.

\n
\n \n
\n
" + }, + "429": { + "json": { + "errors": [ + "Bad Request" + ] + }, + "html": "
\n
\n
\n
\n

errors [required]

\n
\n

[string]

\n

A list of errors.

\n
\n \n
\n
" + } + }, + "request": { + "json_curl": { + "data": { + "attributes": { + "json_patch": [ + { + "op": "add", + "path": "/name" + } + ] + } + } + }, + "json": { + "data": { + "attributes": { + "json_patch": [ + { + "op": "add", + "path": "/name", + "value": "undefined" + } + ] + }, + "type": "string" + } + }, + "html": "
\n
\n
\n
\n

data [required]

\n
\n

object

\n
\n
\n
\n
\n
\n
\n

attributes

\n
\n

object

\n
\n
\n
\n
\n
\n
\n

json_patch

\n
\n

[object]

\n

JSON Patch operations following RFC 6902.

\n
\n
\n
\n
\n
\n

op [required]

\n
\n

enum

\n

The operation to perform. \nAllowed enum values: add,remove,replace,move,copy,test

\n
\n \n
\n
\n
\n
\n
\n

path [required]

\n
\n

string

\n

A JSON Pointer path (e.g., "/name", "/value/secure").

\n
\n \n
\n
\n
\n
\n
\n

value

\n
\n

\n

The value to use for the operation (not applicable for "remove" and "test" operations).

\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n

type

\n
\n

enum

\n

Global variable JSON Patch type. \nAllowed enum values: global_variables_json_patch

\n
\n \n
\n
\n
\n
" + } } } \ No newline at end of file diff --git a/data/api/v2/full_spec.yaml b/data/api/v2/full_spec.yaml index 86def950cf6bb..dad2fa3aef80a 100644 --- a/data/api/v2/full_spec.yaml +++ b/data/api/v2/full_spec.yaml @@ -23664,6 +23664,61 @@ components: required: - type type: object + GlobalVariableData: + description: Synthetics global variable data. Wrapper around the global variable + object. + properties: + attributes: + $ref: '#/components/schemas/SyntheticsGlobalVariable' + id: + description: Global variable identifier. + type: string + type: + $ref: '#/components/schemas/GlobalVariableType' + type: object + GlobalVariableJsonPatchRequest: + description: JSON Patch request for global variable. + properties: + data: + $ref: '#/components/schemas/GlobalVariableJsonPatchRequestData' + required: + - data + type: object + GlobalVariableJsonPatchRequestData: + properties: + attributes: + $ref: '#/components/schemas/GlobalVariableJsonPatchRequestDataAttributes' + type: + $ref: '#/components/schemas/GlobalVariableJsonPatchType' + type: object + GlobalVariableJsonPatchRequestDataAttributes: + properties: + json_patch: + description: JSON Patch operations following RFC 6902. + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + type: object + GlobalVariableJsonPatchType: + description: Global variable JSON Patch type. + enum: + - global_variables_json_patch + type: string + x-enum-varnames: + - GLOBAL_VARIABLES_JSON_PATCH + GlobalVariableResponse: + description: Global variable response. + properties: + data: + $ref: '#/components/schemas/GlobalVariableData' + type: object + GlobalVariableType: + description: Global variable type. + enum: + - global_variables + type: string + x-enum-varnames: + - GLOBAL_VARIABLES GoogleMeetConfigurationReference: description: A reference to a Google Meet Configuration resource. nullable: true @@ -28417,6 +28472,40 @@ components: - to - index type: object + JsonPatchOperation: + description: A JSON Patch operation as per RFC 6902. + properties: + op: + $ref: '#/components/schemas/JsonPatchOperationOp' + path: + description: A JSON Pointer path (e.g., "/name", "/value/secure"). + example: /name + type: string + value: + description: The value to use for the operation (not applicable for "remove" + and "test" operations). + required: + - op + - path + type: object + JsonPatchOperationOp: + description: The operation to perform. + enum: + - add + - remove + - replace + - move + - copy + - test + example: add + type: string + x-enum-varnames: + - ADD + - REMOVE + - REPLACE + - MOVE + - COPY + - TEST KindAttributes: description: Kind attributes. properties: @@ -51755,6 +51844,178 @@ components: format: double type: number type: object + SyntheticsGlobalVariable: + description: Synthetic global variable. + properties: + attributes: + $ref: '#/components/schemas/SyntheticsGlobalVariableAttributes' + description: + description: Description of the global variable. + example: Example description + type: string + id: + description: Unique identifier of the global variable. + readOnly: true + type: string + is_fido: + description: Determines if the global variable is a FIDO variable. + type: boolean + is_totp: + description: Determines if the global variable is a TOTP/MFA variable. + type: boolean + name: + description: Name of the global variable. Unique across Synthetic global + variables. + example: MY_VARIABLE + type: string + parse_test_options: + $ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptions' + parse_test_public_id: + description: A Synthetic test ID to use as a test to generate the variable + value. + example: abc-def-123 + type: string + tags: + description: Tags of the global variable. + example: + - team:front + - test:workflow-1 + items: + description: Tag name. + type: string + type: array + value: + $ref: '#/components/schemas/SyntheticsGlobalVariableValue' + required: + - description + - name + - tags + - value + type: object + SyntheticsGlobalVariableAttributes: + description: Attributes of the global variable. + properties: + restricted_roles: + $ref: '#/components/schemas/SyntheticsRestrictedRoles' + type: object + SyntheticsGlobalVariableOptions: + description: Options for the Global Variable for MFA. + properties: + totp_parameters: + $ref: '#/components/schemas/SyntheticsGlobalVariableTOTPParameters' + type: object + SyntheticsGlobalVariableParseTestOptions: + description: Parser options to use for retrieving a Synthetic global variable + from a Synthetic test. Used in conjunction with `parse_test_public_id`. + properties: + field: + description: When type is `http_header`, name of the header to use to extract + the value. + example: content-type + type: string + localVariableName: + description: When type is `local_variable`, name of the local variable to + use to extract the value. + example: LOCAL_VARIABLE + type: string + parser: + $ref: '#/components/schemas/SyntheticsVariableParser' + type: + $ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptionsType' + required: + - type + type: object + SyntheticsGlobalVariableParseTestOptionsType: + description: Type of value to extract from a test for a Synthetic global variable. + enum: + - http_body + - http_header + - http_status_code + - local_variable + example: http_body + type: string + x-enum-varnames: + - HTTP_BODY + - HTTP_HEADER + - HTTP_STATUS_CODE + - LOCAL_VARIABLE + SyntheticsGlobalVariableParserType: + description: Type of parser for a Synthetic global variable from a synthetics + test. + enum: + - raw + - json_path + - regex + - x_path + example: raw + type: string + x-enum-varnames: + - RAW + - JSON_PATH + - REGEX + - X_PATH + SyntheticsGlobalVariableTOTPParameters: + description: Parameters for the TOTP/MFA variable + properties: + digits: + description: Number of digits for the OTP code. + example: 6 + format: int32 + maximum: 10 + minimum: 4 + type: integer + refresh_interval: + description: Interval for which to refresh the token (in seconds). + example: 30 + format: int32 + maximum: 999 + minimum: 0 + type: integer + type: object + SyntheticsGlobalVariableValue: + description: Value of the global variable. + example: + secure: true + value: value + properties: + options: + $ref: '#/components/schemas/SyntheticsGlobalVariableOptions' + secure: + description: Determines if the value of the variable is hidden. + type: boolean + value: + description: 'Value of the global variable. When reading a global variable, + + the value will not be present if the variable is hidden with the `secure` + property.' + example: example-value + type: string + type: object + SyntheticsRestrictedRoles: + description: A list of role identifiers that can be pulled from the Roles API, + for restricting read and write access. + example: + - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + items: + description: UUID for a role. + example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + type: string + type: array + SyntheticsVariableParser: + description: Details of the parser to use for the global variable. + example: + type: regex + value: .* + properties: + type: + $ref: '#/components/schemas/SyntheticsGlobalVariableParserType' + value: + description: Regex or JSON path used for the parser. Not used with type + `raw`. + type: string + required: + - type + type: object TableResultV2: description: A reference table resource containing its full configuration and state. @@ -83556,6 +83817,61 @@ paths: operator: OR permissions: - billing_edit + /api/v2/synthetics/variables/{variable_id}/jsonpatch: + patch: + description: 'Patch a global variable using JSON Patch (RFC 6902). + + This endpoint allows partial updates to a global variable by specifying only + the fields to modify. + + + Common operations include: + + - Replace field values: `{"op": "replace", "path": "/name", "value": "new_name"}` + + - Update nested values: `{"op": "replace", "path": "/value/value", "value": + "new_value"}` + + - Add/update tags: `{"op": "add", "path": "/tags/-", "value": "new_tag"}` + + - Remove fields: `{"op": "remove", "path": "/description"}`' + operationId: PatchGlobalVariable + parameters: + - description: The ID of the global variable. + in: path + name: variable_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalVariableJsonPatchRequest' + description: JSON Patch document with operations to apply. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalVariableResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Patch a global variable + tags: + - Synthetics + x-codegen-request-body-name: body + x-menu-order: 20 + x-permission: + operator: OR + permissions: + - synthetics_global_variable_write /api/v2/tags/enrichment: get: description: List all tag pipeline rulesets - Retrieve a list of all tag pipeline diff --git a/data/api/v2/translate_actions.json b/data/api/v2/translate_actions.json index d009a396a564f..9e311417896dc 100644 --- a/data/api/v2/translate_actions.json +++ b/data/api/v2/translate_actions.json @@ -3062,6 +3062,12 @@ "request_description": ".", "request_schema_description": "On-demand concurrency cap attributes." }, + "PatchGlobalVariable": { + "description": "Patch a global variable using JSON Patch (RFC 6902).\nThis endpoint allows partial updates to a global variable by specifying only the fields to modify.\n\nCommon operations include:\n- Replace field values: `{\"op\": \"replace\", \"path\": \"/name\", \"value\": \"new_name\"}`\n- Update nested values: `{\"op\": \"replace\", \"path\": \"/value/value\", \"value\": \"new_value\"}`\n- Add/update tags: `{\"op\": \"add\", \"path\": \"/tags/-\", \"value\": \"new_tag\"}`\n- Remove fields: `{\"op\": \"remove\", \"path\": \"/description\"}`", + "summary": "Patch a global variable", + "request_description": "JSON Patch document with operations to apply.", + "request_schema_description": "JSON Patch request for global variable." + }, "ListTagPipelinesRulesets": { "description": "List all tag pipeline rulesets - Retrieve a list of all tag pipeline rulesets for the organization", "summary": "List tag pipeline rulesets"