v1

latestOpenAPI 3.0.02026-07-141,4077,1665.2 MB
Cloud Cost Management

Update tag pipeline ruleset

Update a tag pipeline ruleset - Update an existing tag pipeline ruleset with new rules and configuration

patch/api/v2/tags/enrichment/{ruleset_id}

Path parameters

ruleset_idstring required

The unique identifier of the ruleset

Request body

Example request

{
  "data": {
    "attributes": {
      "enabled": true,
      "last_version": 1,
      "name": "Updated Ruleset",
      "rules": [
        {
          "enabled": true,
          "mapping": null,
          "metadata": null,
          "name": "Add Cost Center Tag",
          "query": {
            "addition": {
              "key": "cost_center",
              "value": "engineering"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "account_id:\"123456789\" AND service:\"web-api\""
          },
          "reference_table": null
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "metadata": null,
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        },
        {
          "enabled": true,
          "mapping": null,
          "metadata": null,
          "name": "New table rule with new UI",
          "query": null,
          "reference_table": {
            "case_insensitivity": true,
            "field_pairs": [
              {
                "input_column": "status_type",
                "output_key": "status"
              },
              {
                "input_column": "status_description",
                "output_key": "dess"
              }
            ],
            "if_tag_exists": "append",
            "source_keys": [
              "http_status",
              "status_description"
            ],
            "table_name": "http_status_codes"
          }
        }
      ]
    },
    "type": "update_ruleset"
  }
}

Response

OK

Example response

{
  "data": {
    "attributes": {
      "created": null,
      "enabled": true,
      "last_modified_user_uuid": "",
      "modified": null,
      "name": "Example Ruleset",
      "position": 0,
      "rules": [
        {
          "enabled": false,
          "mapping": null,
          "metadata": null,
          "name": "RC test rule edited1",
          "query": {
            "addition": {
              "key": "abc",
              "value": "ww"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "billingcurrency:\"USD\" AND account_name:\"SZA96462\" AND billingcurrency:\"USD\""
          },
          "reference_table": null
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "h",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "accountname",
              "accountownerid"
            ]
          },
          "metadata": null,
          "name": "rule with empty source key",
          "query": null,
          "reference_table": null
        },
        {
          "enabled": true,
          "mapping": null,
          "metadata": null,
          "name": "New table rule with new UI",
          "query": null,
          "reference_table": {
            "case_insensitivity": true,
            "field_pairs": [
              {
                "input_column": "status_type",
                "output_key": "status"
              },
              {
                "input_column": "status_description",
                "output_key": "dess"
              }
            ],
            "if_tag_exists": "append",
            "source_keys": [
              "http_status",
              "status_description"
            ],
            "table_name": "http_status_codes"
          }
        }
      ],
      "version": 1
    },
    "id": "12345",
    "type": "ruleset"
  }
}