{"action":"created","comment":{"url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/comments/207212272","pull_request_review_id":142774860,"id":207212272,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzIxMjI3Mg==","diff_hunk":"@@ -0,0 +1,76 @@\n+#!/usr/bin/env bash\n+\n+# This script will get all the ElasticSearch indexes that uses a given alias, the alias will\n+# be removed from those indexes, before the index name that is passed into this script\n+# is aliased using the given alias.\n+# e.g. sh ./scripts/alias_index.sh localhost 9200 bi-dev-01082018 bi-dev\n+# - The indexes aliased to 'bi-dev' will have their aliases removed (if any exist).\n+# - The passed in index name will be aliased using the given alias ('bi-dev').\n+# https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html#indices-aliases\n+\n+__SCRIPT_NAME=${BASH_SOURCE[0]}\n+REQUIRED_NUM_ARGS=4","path":"scripts/alias_index.sh","position":12,"original_position":12,"commit_id":"a117ffa6304d5f723eb45d7398ff7899e093aa5c","original_commit_id":"a117ffa6304d5f723eb45d7398ff7899e093aa5c","user":{"login":"willis7","id":3193414,"node_id":"MDQ6VXNlcjMxOTM0MTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/3193414?v=4","gravatar_id":"","url":"https://api.github.com/users/willis7","html_url":"https://github.com/willis7","followers_url":"https://api.github.com/users/willis7/followers","following_url":"https://api.github.com/users/willis7/following{/other_user}","gists_url":"https://api.github.com/users/willis7/gists{/gist_id}","starred_url":"https://api.github.com/users/willis7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willis7/subscriptions","organizations_url":"https://api.github.com/users/willis7/orgs","repos_url":"https://api.github.com/users/willis7/repos","events_url":"https://api.github.com/users/willis7/events{/privacy}","received_events_url":"https://api.github.com/users/willis7/received_events","type":"User","site_admin":false},"body":":water_buffalo: ","created_at":"2018-08-02T12:47:38Z","updated_at":"2018-08-02T12:50:14Z","html_url":"https://github.com/ONSdigital/business-index-elastic-index/pull/3#discussion_r207212272","pull_request_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/3","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/comments/207212272"},"html":{"href":"https://github.com/ONSdigital/business-index-elastic-index/pull/3#discussion_r207212272"},"pull_request":{"href":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/3","id":205462225,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1NDYyMjI1","html_url":"https://github.com/ONSdigital/business-index-elastic-index/pull/3","diff_url":"https://github.com/ONSdigital/business-index-elastic-index/pull/3.diff","patch_url":"https://github.com/ONSdigital/business-index-elastic-index/pull/3.patch","issue_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/issues/3","number":3,"state":"open","locked":false,"title":"Feature/alias index","user":{"login":"ONS-Tom","id":23335263,"node_id":"MDQ6VXNlcjIzMzM1MjYz","avatar_url":"https://avatars0.githubusercontent.com/u/23335263?v=4","gravatar_id":"","url":"https://api.github.com/users/ONS-Tom","html_url":"https://github.com/ONS-Tom","followers_url":"https://api.github.com/users/ONS-Tom/followers","following_url":"https://api.github.com/users/ONS-Tom/following{/other_user}","gists_url":"https://api.github.com/users/ONS-Tom/gists{/gist_id}","starred_url":"https://api.github.com/users/ONS-Tom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONS-Tom/subscriptions","organizations_url":"https://api.github.com/users/ONS-Tom/orgs","repos_url":"https://api.github.com/users/ONS-Tom/repos","events_url":"https://api.github.com/users/ONS-Tom/events{/privacy}","received_events_url":"https://api.github.com/users/ONS-Tom/received_events","type":"User","site_admin":false},"body":"- Add `alias_index.sh` script which will check if an ElasticSearch index has a given alias, the alias will be removed for that index, before a given index name is aliased\r\n- Add step in `Jenkinsfile` to call alias index script\r\n\r\nE.g. given a current index `bi-dev-january-2018` exists with a `bi-dev` alias, if a new index `bi-dev-august-2018` is passed in to the script with an alias `bi-dev`, the `bi-dev` alias will be removed from `bi-dev-january-2018` and added to `bi-dev-august-2018`.\r\n\r\nNote: at the moment, the `alias_index.sh` script can only handle de-aliasing one index due to the difficulty of parsing JSON in shell scripts without external dependancies. This should not be an issue as one index should only ever have one alias, a future PR will solve this issue.\r\n\r\nA future PR will deal with parameters for passing in an `environment`, so that no index name needs to be specified, instead being generated.","created_at":"2018-08-01T15:21:45Z","updated_at":"2018-08-02T12:50:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2bd5b9f18f182491a861a7a36d8548e34a926b0e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"awharris","id":24940095,"node_id":"MDQ6VXNlcjI0OTQwMDk1","avatar_url":"https://avatars3.githubusercontent.com/u/24940095?v=4","gravatar_id":"","url":"https://api.github.com/users/awharris","html_url":"https://github.com/awharris","followers_url":"https://api.github.com/users/awharris/followers","following_url":"https://api.github.com/users/awharris/following{/other_user}","gists_url":"https://api.github.com/users/awharris/gists{/gist_id}","starred_url":"https://api.github.com/users/awharris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awharris/subscriptions","organizations_url":"https://api.github.com/users/awharris/orgs","repos_url":"https://api.github.com/users/awharris/repos","events_url":"https://api.github.com/users/awharris/events{/privacy}","received_events_url":"https://api.github.com/users/awharris/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/3/commits","review_comments_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/3/comments","review_comment_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/issues/3/comments","statuses_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/statuses/a117ffa6304d5f723eb45d7398ff7899e093aa5c","head":{"label":"ONSdigital:feature/alias-index","ref":"feature/alias-index","sha":"a117ffa6304d5f723eb45d7398ff7899e093aa5c","user":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":141686568,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE2ODY1Njg=","name":"business-index-elastic-index","full_name":"ONSdigital/business-index-elastic-index","owner":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/business-index-elastic-index","description":"Elastic Search Index definition for BI","fork":false,"url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index","forks_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/forks","keys_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/teams","hooks_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/events","assignees_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/tags","blobs_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/subscription","commits_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/merges","archive_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/downloads","issues_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/deployments","created_at":"2018-07-20T08:38:25Z","updated_at":"2018-07-31T08:41:01Z","pushed_at":"2018-08-02T12:33:37Z","git_url":"git://github.com/ONSdigital/business-index-elastic-index.git","ssh_url":"git@github.com:ONSdigital/business-index-elastic-index.git","clone_url":"https://github.com/ONSdigital/business-index-elastic-index.git","svn_url":"https://github.com/ONSdigital/business-index-elastic-index","homepage":null,"size":6,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"ONSdigital:master","ref":"master","sha":"e648197ce4ec33207d651e72f7c26d61cb14c58a","user":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":141686568,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE2ODY1Njg=","name":"business-index-elastic-index","full_name":"ONSdigital/business-index-elastic-index","owner":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/business-index-elastic-index","description":"Elastic Search Index definition for BI","fork":false,"url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index","forks_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/forks","keys_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/teams","hooks_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/events","assignees_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/tags","blobs_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/subscription","commits_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/merges","archive_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/downloads","issues_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/deployments","created_at":"2018-07-20T08:38:25Z","updated_at":"2018-07-31T08:41:01Z","pushed_at":"2018-08-02T12:33:37Z","git_url":"git://github.com/ONSdigital/business-index-elastic-index.git","ssh_url":"git@github.com:ONSdigital/business-index-elastic-index.git","clone_url":"https://github.com/ONSdigital/business-index-elastic-index.git","svn_url":"https://github.com/ONSdigital/business-index-elastic-index","homepage":null,"size":6,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/3"},"html":{"href":"https://github.com/ONSdigital/business-index-elastic-index/pull/3"},"issue":{"href":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/issues/3"},"comments":{"href":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/ONSdigital/business-index-elastic-index/statuses/a117ffa6304d5f723eb45d7398ff7899e093aa5c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"willis7"}}