diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index 17b0629b6..e4fc9e894 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -8,8 +8,8 @@ on: - main - development-* env: - OPENSEARCH_DASHBOARDS_VERSION: '2.0.0' - OPENSEARCH_VERSION: '2.0.0-SNAPSHOT' + OPENSEARCH_DASHBOARDS_VERSION: '2.x' + OPENSEARCH_VERSION: '2.1.0-SNAPSHOT' jobs: tests: name: Run Cypress E2E tests diff --git a/.github/workflows/unit-tests-workflow.yml b/.github/workflows/unit-tests-workflow.yml index 76858c61e..33daa7ec8 100644 --- a/.github/workflows/unit-tests-workflow.yml +++ b/.github/workflows/unit-tests-workflow.yml @@ -8,7 +8,7 @@ on: - main - development-* env: - OPENSEARCH_DASHBOARDS_VERSION: '2.0' + OPENSEARCH_DASHBOARDS_VERSION: '2.x' jobs: tests: name: Run unit tests diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index 859f70e00..b93343c00 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "indexManagementDashboards", - "version": "2.0.0.0", - "opensearchDashboardsVersion": "2.0.0", + "version": "2.1.0.0", + "opensearchDashboardsVersion": "2.1.0", "configPath": ["opensearch_index_management"], "requiredPlugins": ["navigation"], "server": true, diff --git a/package.json b/package.json index 6cbe3f52c..5a0725edb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensearch_index_management_dashboards", - "version": "2.0.0.0", + "version": "2.1.0.0", "description": "Opensearch Dashboards plugin for Index Management", "main": "index.js", "license": "Apache-2.0", diff --git a/public/services/SnapshotManagementService.ts b/public/services/SnapshotManagementService.ts index 00fb6911a..7035bed04 100644 --- a/public/services/SnapshotManagementService.ts +++ b/public/services/SnapshotManagementService.ts @@ -53,7 +53,6 @@ export default class SnapshotManagementService { createPolicy = async (policyId: string, policy: SMPolicy): Promise> => { let url = `..${NODE_API.SMPolicies}/${policyId}`; const response = (await this.httpClient.post(url, { body: JSON.stringify(policy) })) as ServerResponse; - console.log(`sm dev public create sm policy response ${JSON.stringify(response)}`); return response; }; @@ -67,14 +66,12 @@ export default class SnapshotManagementService { const response = (await this.httpClient.put(url, { query: { seqNo, primaryTerm }, body: JSON.stringify(policy) })) as ServerResponse< DocumentSMPolicy >; - console.log(`sm dev public update sm policy response ${JSON.stringify(response)}`); return response; }; getPolicies = async (queryObject: HttpFetchQuery): Promise> => { let url = `..${NODE_API.SMPolicies}`; const response = (await this.httpClient.get(url, { query: queryObject })) as ServerResponse; - console.log(`sm dev public get sm policies response ${JSON.stringify(response)}`); return response; }; @@ -105,28 +102,24 @@ export default class SnapshotManagementService { catRepositories = async (): Promise> => { const url = `..${NODE_API._REPOSITORIES}`; const response = (await this.httpClient.get(url)) as ServerResponse; - console.log(`sm dev get repositories ${JSON.stringify(response)}`); return response; }; getRepository = async (repo: string): Promise> => { const url = `..${NODE_API._REPOSITORIES}/${repo}`; const response = (await this.httpClient.get(url)) as ServerResponse; - console.log(`sm dev get repository ${JSON.stringify(response)}`); return response; }; createRepository = async (repo: string, createRepoBody: CreateRepositoryBody): Promise> => { const url = `..${NODE_API._REPOSITORIES}/${repo}`; const response = (await this.httpClient.put(url, { body: JSON.stringify(createRepoBody) })) as ServerResponse; - console.log(`sm dev create repository ${JSON.stringify(response)}`); return response; }; deleteRepository = async (repo: string): Promise> => { const url = `..${NODE_API._REPOSITORIES}/${repo}`; const response = (await this.httpClient.delete(url)) as ServerResponse; - console.log(`sm dev delete repository ${JSON.stringify(response)}`); return response; }; } diff --git a/server/services/SnapshotManagementService.ts b/server/services/SnapshotManagementService.ts index cdb5b91a3..3d4324f2a 100644 --- a/server/services/SnapshotManagementService.ts +++ b/server/services/SnapshotManagementService.ts @@ -44,7 +44,6 @@ export default class SnapshotManagementService { let repositories: string[]; if (getRepositoryRes.payload?.ok) { repositories = getRepositoryRes.payload?.response.map((repo) => repo.id); - console.log(`sm dev get repositories ${JSON.stringify(repositories)}`); } else { return response.custom({ statusCode: 200, @@ -83,24 +82,6 @@ export default class SnapshotManagementService { snapshots = [...snapshots, ...snapshotWithPolicy]; } - // populate policy field for snapshot - // const getSMPoliciesRes = await this.getPolicies(context, request, response); - // if (getSMPoliciesRes.payload?.ok) { - // const policyNames = getSMPoliciesRes.payload?.response.policies - // .map((policy) => policy.policy.name) - // .sort((a, b) => b.length - a.length); - // console.log(`sm dev get snapshot policies ${policyNames}`); - // function addPolicyField(snapshot: CatSnapshotWithRepoAndPolicy) { - // for (let i = 0; i < policyNames.length; i++) { - // if (snapshot.id.startsWith(policyNames[i])) { - // return { ...snapshot, policy: policyNames[i] }; - // } - // } - // return snapshot; - // } - // snapshots = snapshots.map(addPolicyField); - // } - return response.custom({ statusCode: 200, body: { @@ -136,7 +117,6 @@ export default class SnapshotManagementService { ignore_unavailable: true, }); - console.log(`sm dev get snapshot response: ${JSON.stringify(res)}`); return response.custom({ statusCode: 200, body: { @@ -167,7 +147,6 @@ export default class SnapshotManagementService { snapshot: `${id}`, }); - console.log(`sm dev delete snapshot response: ${JSON.stringify(resp)}`); return response.custom({ statusCode: 200, body: { @@ -201,7 +180,6 @@ export default class SnapshotManagementService { const { callAsCurrentUser: callWithRequest } = this.osDriver.asScoped(request); const resp: CreateSnapshotResponse = await callWithRequest("snapshot.create", params); - console.log(`sm dev createSnapshot response: ${JSON.stringify(resp)}`); return response.custom({ statusCode: 200, body: { @@ -226,8 +204,6 @@ export default class SnapshotManagementService { body: JSON.stringify(request.body), }; - console.log(`sm dev create policy ${JSON.stringify(request.body)}`); - const { callAsCurrentUser: callWithRequest } = this.osDriver.asScoped(request); const rawRes = await callWithRequest("ism.createSMPolicy", params); const res: DocumentSMPolicy = { @@ -237,8 +213,6 @@ export default class SnapshotManagementService { policy: rawRes.sm_policy, }; - console.log(`sm dev server create policy response: ${JSON.stringify(res)}`); - return response.custom({ statusCode: 200, body: { @@ -266,8 +240,6 @@ export default class SnapshotManagementService { body: JSON.stringify(request.body), }; - console.log(`sm dev update policy ${JSON.stringify(request.body)}`); - const { callAsCurrentUser: callWithRequest } = this.osDriver.asScoped(request); const rawRes = await callWithRequest("ism.updateSMPolicy", params); const res: DocumentSMPolicy = { @@ -276,7 +248,6 @@ export default class SnapshotManagementService { id: rawRes._id, policy: rawRes.sm_policy, }; - console.log(`sm dev server update policy response: ${JSON.stringify(res)}`); return response.custom({ statusCode: 200, @@ -312,7 +283,6 @@ export default class SnapshotManagementService { sortOrder, queryString: queryString.trim() ? `${queryString.trim()}` : "*", }; - console.log(`sm dev get policies ${JSON.stringify(params)}`); const res = await callWithRequest("ism.getSMPolicies", params); const policies: DocumentSMPolicy[] = res.policies.map( @@ -355,7 +325,6 @@ export default class SnapshotManagementService { const { callAsCurrentUser: callWithRequest } = this.osDriver.asScoped(request); const getResponse = await callWithRequest("ism.getSMPolicy", params); const metadata = await callWithRequest("ism.explainSnapshotPolicy", params); - console.log(`sm dev metadata ${JSON.stringify(metadata)}`); const documentPolicy = { id: id, seqNo: getResponse._seq_no, @@ -477,7 +446,6 @@ export default class SnapshotManagementService { const res: CatRepository[] = await callWithRequest("cat.repositories", { format: "json", }); - console.log(`sm dev cat repositories response: ${JSON.stringify(res)}`); return response.custom({ statusCode: 200, body: { @@ -510,7 +478,6 @@ export default class SnapshotManagementService { res[i].snapshotCount = getSnapshotRes.snapshots.length; } - console.log(`sm dev cat repositories with snapshot count response: ${JSON.stringify(res)}`); return response.custom({ statusCode: 200, body: { @@ -534,7 +501,6 @@ export default class SnapshotManagementService { const res: AcknowledgedResponse = await callWithRequest("snapshot.deleteRepository", { repository: id, }); - console.log(`sm dev delete repository response: ${JSON.stringify(res)}`); return response.custom({ statusCode: 200, body: { @@ -558,7 +524,6 @@ export default class SnapshotManagementService { const res: GetRepositoryResponse = await callWithRequest("snapshot.getRepository", { repository: id, }); - console.log(`sm dev get repository response: ${JSON.stringify(res)}`); return response.custom({ statusCode: 200, body: { @@ -582,10 +547,8 @@ export default class SnapshotManagementService { repository: id, body: JSON.stringify(request.body), }; - console.log(`sm dev create repo params ${JSON.stringify(params)}`); const { callAsCurrentUser: callWithRequest } = this.osDriver.asScoped(request); const res: AcknowledgedResponse = await callWithRequest("snapshot.createRepository", params); - console.log(`sm dev create repository response: ${JSON.stringify(res)}`); return response.custom({ statusCode: 200, body: {