Skip to content

Commit

Permalink
Version bump 2.1.0
Browse files Browse the repository at this point in the history
Signed-off-by: bowenlan-amzn <[email protected]>
  • Loading branch information
bowenlan-amzn committed Jun 24, 2022
1 parent 46dd590 commit e9591e3
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- main
- development-*
env:
OPENSEARCH_DASHBOARDS_VERSION: '2.0'
OPENSEARCH_DASHBOARDS_VERSION: '2.x'
jobs:
tests:
name: Run unit tests
Expand Down
4 changes: 2 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 0 additions & 7 deletions public/services/SnapshotManagementService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export default class SnapshotManagementService {
createPolicy = async (policyId: string, policy: SMPolicy): Promise<ServerResponse<DocumentSMPolicy>> => {
let url = `..${NODE_API.SMPolicies}/${policyId}`;
const response = (await this.httpClient.post(url, { body: JSON.stringify(policy) })) as ServerResponse<DocumentSMPolicy>;
console.log(`sm dev public create sm policy response ${JSON.stringify(response)}`);
return response;
};

Expand All @@ -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<ServerResponse<GetSMPoliciesResponse>> => {
let url = `..${NODE_API.SMPolicies}`;
const response = (await this.httpClient.get(url, { query: queryObject })) as ServerResponse<GetSMPoliciesResponse>;
console.log(`sm dev public get sm policies response ${JSON.stringify(response)}`);
return response;
};

Expand Down Expand Up @@ -105,28 +102,24 @@ export default class SnapshotManagementService {
catRepositories = async (): Promise<ServerResponse<CatRepository[]>> => {
const url = `..${NODE_API._REPOSITORIES}`;
const response = (await this.httpClient.get(url)) as ServerResponse<CatRepository[]>;
console.log(`sm dev get repositories ${JSON.stringify(response)}`);
return response;
};

getRepository = async (repo: string): Promise<ServerResponse<any>> => {
const url = `..${NODE_API._REPOSITORIES}/${repo}`;
const response = (await this.httpClient.get(url)) as ServerResponse<any>;
console.log(`sm dev get repository ${JSON.stringify(response)}`);
return response;
};

createRepository = async (repo: string, createRepoBody: CreateRepositoryBody): Promise<ServerResponse<any>> => {
const url = `..${NODE_API._REPOSITORIES}/${repo}`;
const response = (await this.httpClient.put(url, { body: JSON.stringify(createRepoBody) })) as ServerResponse<any>;
console.log(`sm dev create repository ${JSON.stringify(response)}`);
return response;
};

deleteRepository = async (repo: string): Promise<ServerResponse<any>> => {
const url = `..${NODE_API._REPOSITORIES}/${repo}`;
const response = (await this.httpClient.delete(url)) as ServerResponse<any>;
console.log(`sm dev delete repository ${JSON.stringify(response)}`);
return response;
};
}
37 changes: 0 additions & 37 deletions server/services/SnapshotManagementService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand All @@ -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 = {
Expand All @@ -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: {
Expand Down Expand Up @@ -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 = {
Expand All @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -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: {
Expand Down

0 comments on commit e9591e3

Please sign in to comment.