Skip to content

Commit

Permalink
Merge pull request #16 from Scalr/add_filters
Browse files Browse the repository at this point in the history
Add filter by environment and tags
  • Loading branch information
emocharnik authored Sep 6, 2024
2 parents a8db83d + a3e0d6f commit bc0ed36
Show file tree
Hide file tree
Showing 7 changed files with 845 additions and 11 deletions.
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.formatOnSave": true
"typescript.tsc.autoDetect": "off"
}
2 changes: 1 addition & 1 deletion openapi-ts.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export default defineConfig({
enums: 'javascript',
},
services: {
filter: '^\\w+ /(accounts|workspaces|runs|plans|applies)',
filter: '^\\w+ /(accounts|workspaces|runs|plans|applies|environments)',
},
});
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,27 @@
"title": "Refresh",
"icon": "$(refresh)",
"enablement": "scalr.signed-in"
},
{
"command": "workspace.filter",
"title": "Filter",
"icon": "$(filter)",
"enablement": "scalr.signed-in"
},
{
"command": "workspace.clearFilters",
"title": "Clear filters",
"icon": "$(clear-all)",
"enablement": "scalr.signed-in"
}
],
"menus": {
"view/title": [
{
"command": "workspace.filter",
"group": "navigation",
"when": "view == workspaces"
},
{
"command": "workspace.refresh",
"group": "navigation",
Expand Down Expand Up @@ -129,6 +146,11 @@
"command": "plan.open",
"group": "inline",
"when": "view == runs && viewItem =~ /planItem/"
},
{
"command": "workspace.clearFilters",
"group": "inline",
"when": "view == workspaces && viewItem =~ /workspaceFilterInfo/"
}
]
}
Expand Down
129 changes: 129 additions & 0 deletions src/api/services.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,33 @@ import type {
GetApplyLogData,
GetApplyLogError,
GetApplyLogResponse,
ListEnvironmentsData,
ListEnvironmentsError,
ListEnvironmentsResponse,
CreateEnvironmentData,
CreateEnvironmentError,
CreateEnvironmentResponse,
DeleteEnvironmentData,
DeleteEnvironmentError,
DeleteEnvironmentResponse,
GetEnvironmentData,
GetEnvironmentError,
GetEnvironmentResponse,
UpdateEnvironmentData,
UpdateEnvironmentError,
UpdateEnvironmentResponse,
DeleteEnvironmentTagsData,
DeleteEnvironmentTagsError,
DeleteEnvironmentTagsResponse,
ListEnvironmentTagsData,
ListEnvironmentTagsError,
ListEnvironmentTagsResponse,
ReplaceEnvironmentTagsData,
ReplaceEnvironmentTagsError,
ReplaceEnvironmentTagsResponse,
AddEnvironmentTagsData,
AddEnvironmentTagsError,
AddEnvironmentTagsResponse,
GetPlanData,
GetPlanError,
GetPlanResponse,
Expand Down Expand Up @@ -301,6 +328,108 @@ export const getApplyLog = (options: Options<GetApplyLogData>) => {
});
};

/**
* List Environments
* This endpoint lists account environments.
*/
export const listEnvironments = (options?: Options<ListEnvironmentsData>) => {
return (options?.client ?? client).get<ListEnvironmentsResponse, ListEnvironmentsError>({
...options,
url: '/environments',
});
};

/**
* Create an Environment
* Create a new environment in the account.
*/
export const createEnvironment = (options?: Options<CreateEnvironmentData>) => {
return (options?.client ?? client).post<CreateEnvironmentResponse, CreateEnvironmentError>({
...options,
url: '/environments',
});
};

/**
* Delete an Environment
*/
export const deleteEnvironment = (options: Options<DeleteEnvironmentData>) => {
return (options?.client ?? client).delete<DeleteEnvironmentResponse, DeleteEnvironmentError>({
...options,
url: '/environments/{environment}',
});
};

/**
* Get an Environment
* Show details of a specific environment.
*/
export const getEnvironment = (options: Options<GetEnvironmentData>) => {
return (options?.client ?? client).get<GetEnvironmentResponse, GetEnvironmentError>({
...options,
url: '/environments/{environment}',
});
};

/**
* Update Environment
*/
export const updateEnvironment = (options: Options<UpdateEnvironmentData>) => {
return (options?.client ?? client).patch<UpdateEnvironmentResponse, UpdateEnvironmentError>({
...options,
url: '/environments/{environment}',
});
};

/**
* Delete environment's tags
* This endpoint removes given [tags](tags.html#the-tag-resource) from the environment.
*
*/
export const deleteEnvironmentTags = (options: Options<DeleteEnvironmentTagsData>) => {
return (options?.client ?? client).delete<DeleteEnvironmentTagsResponse, DeleteEnvironmentTagsError>({
...options,
url: '/environments/{environment}/relationships/tags',
});
};

/**
* List environment's tags
* This endpoint returns a list of [tags](tags.html#the-tag-resource),
* assigned to an environment.
*
*/
export const listEnvironmentTags = (options: Options<ListEnvironmentTagsData>) => {
return (options?.client ?? client).get<ListEnvironmentTagsResponse, ListEnvironmentTagsError>({
...options,
url: '/environments/{environment}/relationships/tags',
});
};

/**
* Replace environment's tags
* This endpoint completely replaces environment's tags with provided list.
*
*/
export const replaceEnvironmentTags = (options: Options<ReplaceEnvironmentTagsData>) => {
return (options?.client ?? client).patch<ReplaceEnvironmentTagsResponse, ReplaceEnvironmentTagsError>({
...options,
url: '/environments/{environment}/relationships/tags',
});
};

/**
* Add tags to the environment
* This endpoint assigns the list of [tags](tags.html#the-tag-resource) to the environment.
*
*/
export const addEnvironmentTags = (options: Options<AddEnvironmentTagsData>) => {
return (options?.client ?? client).post<AddEnvironmentTagsResponse, AddEnvironmentTagsError>({
...options,
url: '/environments/{environment}/relationships/tags',
});
};

/**
* Get a Plan
* Show details of a specific Terraform Plan stage.
Expand Down
Loading

0 comments on commit bc0ed36

Please sign in to comment.