{"__v":0,"_id":"58793b8942ffe30f00e04d32","category":{"__v":14,"_id":"55c6bec2b9aa4e0d0016c2c7","pages":["55c6bec3b9aa4e0d0016c2c9","55c8f451b79cb30d005b3e49","55ccea804906d12f001226e4","56c14ca9f203270d00d6c546","56c3bbeb2d97560d00e23ccf","56cce248ca43550b002814db","56cceaacd98d851d00c0c376","56cceefc723ad71d00cae46d","56ccef4e8fa8b01b00b8200e","56cd03e8723ad71d00cae4af","56cd03f2723ad71d00cae4b1","56cd061eca43550b0028151c","56cd07e4d98d851d00c0c3ba","56df35fbef8c1b320047c2d5"],"project":"55c6bec1b9aa4e0d0016c2c3","version":"55c6bec1b9aa4e0d0016c2c6","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-09T02:45:22.223Z","from_sync":false,"order":0,"slug":"documentation","title":"Guides"},"parentDoc":null,"project":"55c6bec1b9aa4e0d0016c2c3","user":"55c6b99c476be90d00500805","version":{"__v":8,"_id":"55c6bec1b9aa4e0d0016c2c6","project":"55c6bec1b9aa4e0d0016c2c3","createdAt":"2015-08-09T02:45:21.683Z","releaseDate":"2015-08-09T02:45:21.683Z","categories":["55c6bec2b9aa4e0d0016c2c7","56c14bc5826df10d00e82230","56cceed8723ad71d00cae46c","56ccf29a431ada1f00e85aae","56ccf3c28fa8b01b00b82018","56ce1e6ee538330b0021ac5d","56f97e9a4c612020008f2eaf","5734fafd146eb82000597261"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-13T20:41:45.368Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[block:html]\n{\n  \"html\": \"<h1 style=\\\"margin-top: 0; font-size: 25px;\\\"><span style=\\\"color: red\\\">Release Candidate</span> (2017-01-13)</h1>\"\n}\n[/block]\nThis guide provides an introduction to the provider-agnostic tagging capabilities of Spinnaker.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Requirements\"\n}\n[/block]\nThis is an *optional* feature of Spinnaker that requires\n- **Elasticsearch** (tested with 2.3.3)\n- **Front50** (backed by S3 or GCS)\n\nSee [appendix](#appendix) for specific configuration details.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Overview\"\n}\n[/block]\nSpinnaker provides a provider-agnostic way of attaching additional attributes (*key/value pairs*) to any managed entity.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Managed Entities\",\n  \"body\": \"Any object that is maintained (_or visualized_) by Spinnaker.\\n\\nIncludes (*but is not limited to*):\\n- Applications\\n- Server Groups\\n- Load Balancers\\n- Instances\\n- Clusters\"\n}\n[/block]\nThere are no restrictions on the size or quantity of these tags (*unlike limitations imposed by native cloud provider tags*).\n\n## Current Limitations\n- Completely separate from any tag support on the underlying cloud provider\n  - *Callers must make an additional API call to retrieve general purpose tags*\n- Limited lifecycle support\n  - *Only server groups have a delete hook that will cleanup associated tags*\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"These limitations will be addressed on an as needed basis.\\n\\nIf they are blocking a particular use-case, please file an [issue](https://github.com/spinnaker/spinnaker/issues).\"\n}\n[/block]\n## Common Use Cases\n- Server Group Alerts and Notices\n- Server Group Attribution (*what pipeline / user created this server group*)\n- Security (*restricting when particular IAM roles can be used*)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Tag Namespaces\"\n}\n[/block]\nAll tags have an associated namespace (_`default` will be used if unspecified_) that provides a means of grouping tags by a logical owner.\n\nTag names can be re-used across namespaces.\n\nEventually Spinnaker will allow permissions to be defined per-namespace (ie. certain namespaces can only be modified by particular users or groups).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Implementation Details\"\n}\n[/block]\nThese provider-agnostic tags are stored in S3 or GCS (*via Front50*) and indexed via Elasticsearch.\n\nThey are made up of:\n- An `Identifier`\n- An `EntityRef`\n- 1..* Tags (`key`/`value` pairs with the `value` being either a literal or object)\n- 1..* Tag Metadata (*last modified timestamps per tag*)\n\n## Identifier\n\nA unique identifier representing a tagged entity:\n`{{cloudProvider}}:{{entityType}}:{{entityId}}:{{account}}:{{region}}`\n\n## EntityRef\n\n`cloudProvider` The identifier of the cloud provider associated with this entity\n`accountId` The identifier of the account associated with this entity (supports `*` wildcard)\n`region` The identifier of the region associated with this entity (supports `*` wildcard)\n`entityType` The type of entity being tagged\n`entityId` The identifier of the entity being tagged\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Supported Entity Types\",\n  \"body\": \"Spinnaker has native support for the following:\\n- `application`\\n- `servergroup`\\n- `iamrole`\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"    {\\n      \\\"id\\\": \\\"aws:servergroup:myservergroup-v001:100000000001:us-west-2\\\",\\n      \\\"idPattern\\\": \\\"{{cloudProvider}}:{{entityType}}:{{entityId}}:{{account}}:{{region}}\\\",\\n      \\\"tags\\\": [\\n        {\\n          \\\"name\\\": \\\"spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\\\",\\n          \\\"namespace\\\": \\\"my_namespace\\\",\\n          \\\"value\\\": {\\n            \\\"message\\\": \\\"Insufficient capacity. Launching EC2 instance failed.\\\",\\n            \\\"type\\\": \\\"alert\\\"\\n          },\\n          \\\"valueType\\\": \\\"object\\\"\\n        }\\n      ],\\n      \\\"tagsMetadata\\\": [\\n        {\\n          \\\"name\\\": \\\"spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\\\",\\n          \\\"lastModified\\\": 1484162291500,\\n          \\\"lastModifiedBy\\\": \\\"unknown\\\",\\n          \\\"created\\\": 1484161809699,\\n          \\\"createdBy\\\": \\\"unknown\\\"\\n        }\\n      ],\\n      \\\"entityRef\\\": {\\n        \\\"cloudProvider\\\": \\\"aws\\\",\\n        \\\"accountId\\\": \\\"100000000001\\\",\\n        \\\"region\\\": \\\"us-west-2\\\",\\n        \\\"entityType\\\": \\\"servergroup\\\",\\n        \\\"entityId\\\": \\\"myservergroup-v001\\\"\\n      }\\n    }\",\n      \"language\": \"json\",\n      \"name\": \"tags structure\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"API\"\n}\n[/block]\nThe following APIs are exposed in `gate` but are subject to change given the current **release candidate** status.\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"/tags\"\n}\n[/block]\nFetch all tags.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"entityType\",\n    \"0-2\": \"?entityType=servergroup\",\n    \"0-1\": \"Filter by Entity Type\",\n    \"1-0\": \"entityId\",\n    \"1-1\": \"Filter by Entity Id\",\n    \"1-2\": \"?entityId=myservergroup-v001\",\n    \"2-0\": \"tag\",\n    \"2-1\": \"Filter by Tag (specific value)\\nFilter by Tag (any value)\",\n    \"2-2\": \"?tag:my_tag=my_value\\n?tag:my_tag=*\",\n    \"3-0\": \"tag\",\n    \"3-1\": \"Has a tag (any value)\",\n    \"3-2\": \"\",\n    \"h-0\": \"Parameter Name\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Example\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"/tags\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter Name\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Example\",\n    \"0-0\": \"entityType\",\n    \"0-1\": \"Entity Type\",\n    \"0-2\": \"?entityType=servergroup\",\n    \"1-0\": \"entityId\",\n    \"1-1\": \"Entity Id\",\n    \"1-2\": \"?entityId=myservergroup-v001\",\n    \"2-0\": \"account\",\n    \"2-1\": \"Account Name\",\n    \"2-2\": \"?account=production\\n?account=\\\\* (wildcard)\",\n    \"3-0\": \"region\",\n    \"3-1\": \"Region\",\n    \"3-2\": \"?region=us-west-2\\n?region=\\\\* (wildcard)\",\n    \"4-0\": \"cloudProvider\",\n    \"4-1\": \"cloudProvider\",\n    \"4-2\": \"?cloudProvider=aws\\n?cloudProvider=\\\\* (wildcard)\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"    curl -X \\\"POST\\\" \\\"http://gate/tags?entityId=myservergroup=-v001&entityType=servergroup&account=production&region=us-west-2&cloudProvider=aws\\\" \\\\\\n         -H \\\"Content-Type: application/json\\\" \\\\\\n         -d $'[\\n      {\\n        \\\"name\\\": \\\"spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\\\",\\n        \\\"namespace\\\": \\\"my_namespace\\\",\\n        \\\"value\\\": {\\n          \\\"message\\\": \\\"Insufficient capacity. Launching EC2 instance failed.\\\",\\n          \\\"type\\\": \\\"alert\\\"\\n        },\\n        \\\"valueType\\\": \\\"object\\\"\\n      }\\n    ]'\",\n      \"language\": \"shell\",\n      \"name\": \"Upsert Tags\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"/tasks\"\n}\n[/block]\nThis API provides backwards compatibility with traditional Spinnaker tasks and can be used interchangeably with the `POST /tasks` API.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"    curl -X \\\"POST\\\" \\\"http://gate/tasks\\\" \\\\\\n         -H \\\"Content-Type: application/json\\\" \\\\\\n         -d $'{\\n      \\\"application\\\": \\\"spinnaker\\\",\\n      \\\"job\\\": [\\n        {\\n          \\\"type\\\": \\\"upsertEntityTags\\\",\\n          \\\"tags\\\": [\\n            {\\n              \\\"name\\\": \\\"owner\\\",\\n              \\\"namespace\\\": \\\"my_namespace\\\",\\n              \\\"value\\\": \\\"spinnaker\\\"\\n            }\\n          ],\\n          \\\"entityRef\\\": {\\n            \\\"cloudProvider\\\": \\\"aws\\\",\\n            \\\"entityType\\\": \\\"application\\\",\\n            \\\"entityId\\\": \\\"spinnaker\\\"\\n          }\\n        }\\n      ],\\n      \\\"description\\\": \\\"Updating tags\\\"\\n    }'\\n\",\n      \"language\": \"shell\",\n      \"name\": \"Upsert Tags\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"delete\",\n  \"title\": \"/tags/:id/:tagName\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"    curl -X \\\"DELETE\\\" \\\"http://gate/tags/myservergroup-v001:100000000001:us-west-2/spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\\\" \\\\\\n         -H \\\"Content-Type: application/json\\\" \\\\\\n         -d $'{}'\",\n      \"language\": \"shell\",\n      \"name\": \"Delete Tags\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"FEATURE: Server Group Alerts and Notices\"\n}\n[/block]\n*Server Group Alerts and Notices* is a new Spinnaker feature is built upon general purpose tags.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/8216d13-Alert.png\",\n        \"Alert.png\",\n        882,\n        288,\n        \"#405567\"\n      ],\n      \"caption\": \"\",\n      \"sizing\": \"smart\",\n      \"border\": true\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"    curl -X \\\"POST\\\" \\\"http://gate/tags?entityId=spintest-v003&entityType=servergroup&account=test&region=us-west-2&cloudProvider=aws\\\" \\\\\\n         -H \\\"Content-Type: application/json\\\" \\\\\\n         -d $'[\\n      {\\n        \\\"name\\\": \\\"spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\\\",\\n        \\\"namespace\\\": \\\"my_namespace\\\",\\n        \\\"value\\\": {\\n          \\\"message\\\": \\\"You have exceeded the number of VPC security groups allowed per instance. Launching EC2 instance failed.\\\",\\n          \\\"type\\\": \\\"alert\\\"\\n        },\\n        \\\"valueType\\\": \\\"object\\\"\\n      }\\n    ]'\",\n      \"language\": \"shell\",\n      \"name\": \"Add Alert\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"    curl -X \\\"POST\\\" \\\"http://gate/tags?entityId=spintest-v003&entityType=servergroup&account=test&region=us-west-2&cloudProvider=aws\\\" \\\\\\n         -H \\\"Content-Type: application/json\\\" \\\\\\n         -d $'[\\n      {\\n        \\\"name\\\": \\\"spinnaker_ui_notice:my_favorite_notice\\\",\\n        \\\"namespace\\\": \\\"my_namespace\\\",\\n        \\\"value\\\": {\\n          \\\"message\\\": \\\"This is an example notice!\\\",\\n          \\\"type\\\": \\\"notice\\\"\\n        },\\n        \\\"valueType\\\": \\\"object\\\"\\n      }\\n    ]'\",\n      \"language\": \"shell\",\n      \"name\": \"Add Notice\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"    curl -X \\\"DELETE\\\" \\\"http://gate/tags/aws:servergroup:spintest-v003:100000000001:us-west-2/spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\\\" \\\\\\n         -H \\\"Content-Type: application/json\\\" \\\\\\n         -d $'{}'\\n\",\n      \"language\": \"shell\",\n      \"name\": \"Delete Alert (or Notice)\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Appendix\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"elasticSearch:\\n  activeIndex: \\\"tags_v1\\\"\\n  connection: http://my-elastic-search-cluster:7104\",\n      \"language\": \"yaml\",\n      \"name\": \"clouddriver-local.yml\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"order\\\": 0,\\n  \\\"template\\\": \\\"tags_v*\\\",\\n  \\\"settings\\\": {\\n    \\\"index\\\": {\\n      \\\"number_of_shards\\\": \\\"6\\\",\\n      \\\"number_of_replicas\\\": \\\"2\\\",\\n      \\\"refresh_interval\\\": \\\"1s\\\"\\n    }\\n  },\\n  \\\"mappings\\\": {\\n    \\\"_default_\\\": {\\n      \\\"dynamic\\\": \\\"false\\\",\\n      \\\"dynamic_templates\\\": [\\n        {\\n          \\\"tags_template\\\": {\\n            \\\"path_match\\\": \\\"tagsMetadata\\\",\\n            \\\"mapping\\\": {\\n              \\\"index\\\": \\\"no\\\"\\n            }\\n          }\\n        },\\n        {\\n          \\\"entityRef_template\\\": {\\n            \\\"path_match\\\": \\\"entityRef.*\\\",\\n            \\\"mapping\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\"\\n            }\\n          }\\n        }\\n      ],\\n      \\\"properties\\\": {\\n        \\\"entityRef\\\": {\\n          \\\"properties\\\": {\\n            \\\"accountId\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\",\\n              \\\"type\\\": \\\"string\\\"\\n            },\\n            \\\"entityType\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\",\\n              \\\"type\\\": \\\"string\\\"\\n            },\\n            \\\"cloudProvider\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\",\\n              \\\"type\\\": \\\"string\\\"\\n            },\\n            \\\"entityId\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\",\\n              \\\"type\\\": \\\"string\\\"\\n            },\\n            \\\"region\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\",\\n              \\\"type\\\": \\\"string\\\"\\n            },\\n            \\\"account\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\",\\n              \\\"type\\\": \\\"string\\\"\\n            }\\n          }\\n        },\\n        \\\"tags\\\": {\\n          \\\"type\\\": \\\"nested\\\",\\n          \\\"properties\\\": {\\n            \\\"valueType\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\",\\n              \\\"type\\\": \\\"string\\\"\\n            },\\n            \\\"name\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\",\\n              \\\"type\\\": \\\"string\\\"\\n            },\\n            \\\"namespace\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\",\\n              \\\"type\\\": \\\"string\\\"\\n            },\\n            \\\"value\\\": {\\n              \\\"index\\\": \\\"not_analyzed\\\",\\n              \\\"type\\\": \\\"string\\\"\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\\"aliases\\\": {}\\n}\",\n      \"language\": \"json\",\n      \"name\": \"elasticsearch index template\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"general-purpose-tags","type":"basic","title":"General Purpose Tagging Guide"}

General Purpose Tagging Guide


[block:html] { "html": "<h1 style=\"margin-top: 0; font-size: 25px;\"><span style=\"color: red\">Release Candidate</span> (2017-01-13)</h1>" } [/block] This guide provides an introduction to the provider-agnostic tagging capabilities of Spinnaker. [block:api-header] { "type": "basic", "title": "Requirements" } [/block] This is an *optional* feature of Spinnaker that requires - **Elasticsearch** (tested with 2.3.3) - **Front50** (backed by S3 or GCS) See [appendix](#appendix) for specific configuration details. [block:api-header] { "type": "basic", "title": "Overview" } [/block] Spinnaker provides a provider-agnostic way of attaching additional attributes (*key/value pairs*) to any managed entity. [block:callout] { "type": "info", "title": "Managed Entities", "body": "Any object that is maintained (_or visualized_) by Spinnaker.\n\nIncludes (*but is not limited to*):\n- Applications\n- Server Groups\n- Load Balancers\n- Instances\n- Clusters" } [/block] There are no restrictions on the size or quantity of these tags (*unlike limitations imposed by native cloud provider tags*). ## Current Limitations - Completely separate from any tag support on the underlying cloud provider - *Callers must make an additional API call to retrieve general purpose tags* - Limited lifecycle support - *Only server groups have a delete hook that will cleanup associated tags* [block:callout] { "type": "warning", "body": "These limitations will be addressed on an as needed basis.\n\nIf they are blocking a particular use-case, please file an [issue](https://github.com/spinnaker/spinnaker/issues)." } [/block] ## Common Use Cases - Server Group Alerts and Notices - Server Group Attribution (*what pipeline / user created this server group*) - Security (*restricting when particular IAM roles can be used*) [block:api-header] { "type": "basic", "title": "Tag Namespaces" } [/block] All tags have an associated namespace (_`default` will be used if unspecified_) that provides a means of grouping tags by a logical owner. Tag names can be re-used across namespaces. Eventually Spinnaker will allow permissions to be defined per-namespace (ie. certain namespaces can only be modified by particular users or groups). [block:api-header] { "type": "basic", "title": "Implementation Details" } [/block] These provider-agnostic tags are stored in S3 or GCS (*via Front50*) and indexed via Elasticsearch. They are made up of: - An `Identifier` - An `EntityRef` - 1..* Tags (`key`/`value` pairs with the `value` being either a literal or object) - 1..* Tag Metadata (*last modified timestamps per tag*) ## Identifier A unique identifier representing a tagged entity: `{{cloudProvider}}:{{entityType}}:{{entityId}}:{{account}}:{{region}}` ## EntityRef `cloudProvider` The identifier of the cloud provider associated with this entity `accountId` The identifier of the account associated with this entity (supports `*` wildcard) `region` The identifier of the region associated with this entity (supports `*` wildcard) `entityType` The type of entity being tagged `entityId` The identifier of the entity being tagged [block:callout] { "type": "info", "title": "Supported Entity Types", "body": "Spinnaker has native support for the following:\n- `application`\n- `servergroup`\n- `iamrole`" } [/block] [block:code] { "codes": [ { "code": " {\n \"id\": \"aws:servergroup:myservergroup-v001:100000000001:us-west-2\",\n \"idPattern\": \"{{cloudProvider}}:{{entityType}}:{{entityId}}:{{account}}:{{region}}\",\n \"tags\": [\n {\n \"name\": \"spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\",\n \"namespace\": \"my_namespace\",\n \"value\": {\n \"message\": \"Insufficient capacity. Launching EC2 instance failed.\",\n \"type\": \"alert\"\n },\n \"valueType\": \"object\"\n }\n ],\n \"tagsMetadata\": [\n {\n \"name\": \"spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\",\n \"lastModified\": 1484162291500,\n \"lastModifiedBy\": \"unknown\",\n \"created\": 1484161809699,\n \"createdBy\": \"unknown\"\n }\n ],\n \"entityRef\": {\n \"cloudProvider\": \"aws\",\n \"accountId\": \"100000000001\",\n \"region\": \"us-west-2\",\n \"entityType\": \"servergroup\",\n \"entityId\": \"myservergroup-v001\"\n }\n }", "language": "json", "name": "tags structure" } ] } [/block] [block:api-header] { "type": "basic", "title": "API" } [/block] The following APIs are exposed in `gate` but are subject to change given the current **release candidate** status. [block:api-header] { "type": "get", "title": "/tags" } [/block] Fetch all tags. [block:parameters] { "data": { "0-0": "entityType", "0-2": "?entityType=servergroup", "0-1": "Filter by Entity Type", "1-0": "entityId", "1-1": "Filter by Entity Id", "1-2": "?entityId=myservergroup-v001", "2-0": "tag", "2-1": "Filter by Tag (specific value)\nFilter by Tag (any value)", "2-2": "?tag:my_tag=my_value\n?tag:my_tag=*", "3-0": "tag", "3-1": "Has a tag (any value)", "3-2": "", "h-0": "Parameter Name", "h-1": "Description", "h-2": "Example" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "post", "title": "/tags" } [/block] [block:parameters] { "data": { "h-0": "Parameter Name", "h-1": "Description", "h-2": "Example", "0-0": "entityType", "0-1": "Entity Type", "0-2": "?entityType=servergroup", "1-0": "entityId", "1-1": "Entity Id", "1-2": "?entityId=myservergroup-v001", "2-0": "account", "2-1": "Account Name", "2-2": "?account=production\n?account=\\* (wildcard)", "3-0": "region", "3-1": "Region", "3-2": "?region=us-west-2\n?region=\\* (wildcard)", "4-0": "cloudProvider", "4-1": "cloudProvider", "4-2": "?cloudProvider=aws\n?cloudProvider=\\* (wildcard)" }, "cols": 3, "rows": 5 } [/block] [block:code] { "codes": [ { "code": " curl -X \"POST\" \"http://gate/tags?entityId=myservergroup=-v001&entityType=servergroup&account=production&region=us-west-2&cloudProvider=aws\" \\\n -H \"Content-Type: application/json\" \\\n -d $'[\n {\n \"name\": \"spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\",\n \"namespace\": \"my_namespace\",\n \"value\": {\n \"message\": \"Insufficient capacity. Launching EC2 instance failed.\",\n \"type\": \"alert\"\n },\n \"valueType\": \"object\"\n }\n ]'", "language": "shell", "name": "Upsert Tags" } ] } [/block] [block:api-header] { "type": "post", "title": "/tasks" } [/block] This API provides backwards compatibility with traditional Spinnaker tasks and can be used interchangeably with the `POST /tasks` API. [block:code] { "codes": [ { "code": " curl -X \"POST\" \"http://gate/tasks\" \\\n -H \"Content-Type: application/json\" \\\n -d $'{\n \"application\": \"spinnaker\",\n \"job\": [\n {\n \"type\": \"upsertEntityTags\",\n \"tags\": [\n {\n \"name\": \"owner\",\n \"namespace\": \"my_namespace\",\n \"value\": \"spinnaker\"\n }\n ],\n \"entityRef\": {\n \"cloudProvider\": \"aws\",\n \"entityType\": \"application\",\n \"entityId\": \"spinnaker\"\n }\n }\n ],\n \"description\": \"Updating tags\"\n }'\n", "language": "shell", "name": "Upsert Tags" } ] } [/block] [block:api-header] { "type": "delete", "title": "/tags/:id/:tagName" } [/block] [block:code] { "codes": [ { "code": " curl -X \"DELETE\" \"http://gate/tags/myservergroup-v001:100000000001:us-west-2/spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\" \\\n -H \"Content-Type: application/json\" \\\n -d $'{}'", "language": "shell", "name": "Delete Tags" } ] } [/block] [block:api-header] { "type": "basic", "title": "FEATURE: Server Group Alerts and Notices" } [/block] *Server Group Alerts and Notices* is a new Spinnaker feature is built upon general purpose tags. [block:image] { "images": [ { "image": [ "https://files.readme.io/8216d13-Alert.png", "Alert.png", 882, 288, "#405567" ], "caption": "", "sizing": "smart", "border": true } ] } [/block] [block:code] { "codes": [ { "code": " curl -X \"POST\" \"http://gate/tags?entityId=spintest-v003&entityType=servergroup&account=test&region=us-west-2&cloudProvider=aws\" \\\n -H \"Content-Type: application/json\" \\\n -d $'[\n {\n \"name\": \"spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\",\n \"namespace\": \"my_namespace\",\n \"value\": {\n \"message\": \"You have exceeded the number of VPC security groups allowed per instance. Launching EC2 instance failed.\",\n \"type\": \"alert\"\n },\n \"valueType\": \"object\"\n }\n ]'", "language": "shell", "name": "Add Alert" } ] } [/block] [block:code] { "codes": [ { "code": " curl -X \"POST\" \"http://gate/tags?entityId=spintest-v003&entityType=servergroup&account=test&region=us-west-2&cloudProvider=aws\" \\\n -H \"Content-Type: application/json\" \\\n -d $'[\n {\n \"name\": \"spinnaker_ui_notice:my_favorite_notice\",\n \"namespace\": \"my_namespace\",\n \"value\": {\n \"message\": \"This is an example notice!\",\n \"type\": \"notice\"\n },\n \"valueType\": \"object\"\n }\n ]'", "language": "shell", "name": "Add Notice" } ] } [/block] [block:code] { "codes": [ { "code": " curl -X \"DELETE\" \"http://gate/tags/aws:servergroup:spintest-v003:100000000001:us-west-2/spinnaker_ui_alert:autoscaling:ec2_instance_launch_error\" \\\n -H \"Content-Type: application/json\" \\\n -d $'{}'\n", "language": "shell", "name": "Delete Alert (or Notice)" } ] } [/block] [block:api-header] { "type": "basic", "title": "Appendix" } [/block] [block:code] { "codes": [ { "code": "elasticSearch:\n activeIndex: \"tags_v1\"\n connection: http://my-elastic-search-cluster:7104", "language": "yaml", "name": "clouddriver-local.yml" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"order\": 0,\n \"template\": \"tags_v*\",\n \"settings\": {\n \"index\": {\n \"number_of_shards\": \"6\",\n \"number_of_replicas\": \"2\",\n \"refresh_interval\": \"1s\"\n }\n },\n \"mappings\": {\n \"_default_\": {\n \"dynamic\": \"false\",\n \"dynamic_templates\": [\n {\n \"tags_template\": {\n \"path_match\": \"tagsMetadata\",\n \"mapping\": {\n \"index\": \"no\"\n }\n }\n },\n {\n \"entityRef_template\": {\n \"path_match\": \"entityRef.*\",\n \"mapping\": {\n \"index\": \"not_analyzed\"\n }\n }\n }\n ],\n \"properties\": {\n \"entityRef\": {\n \"properties\": {\n \"accountId\": {\n \"index\": \"not_analyzed\",\n \"type\": \"string\"\n },\n \"entityType\": {\n \"index\": \"not_analyzed\",\n \"type\": \"string\"\n },\n \"cloudProvider\": {\n \"index\": \"not_analyzed\",\n \"type\": \"string\"\n },\n \"entityId\": {\n \"index\": \"not_analyzed\",\n \"type\": \"string\"\n },\n \"region\": {\n \"index\": \"not_analyzed\",\n \"type\": \"string\"\n },\n \"account\": {\n \"index\": \"not_analyzed\",\n \"type\": \"string\"\n }\n }\n },\n \"tags\": {\n \"type\": \"nested\",\n \"properties\": {\n \"valueType\": {\n \"index\": \"not_analyzed\",\n \"type\": \"string\"\n },\n \"name\": {\n \"index\": \"not_analyzed\",\n \"type\": \"string\"\n },\n \"namespace\": {\n \"index\": \"not_analyzed\",\n \"type\": \"string\"\n },\n \"value\": {\n \"index\": \"not_analyzed\",\n \"type\": \"string\"\n }\n }\n }\n }\n }\n },\n \"aliases\": {}\n}", "language": "json", "name": "elasticsearch index template" } ] } [/block]