pulumi/sdk/nodejs/automation/workspace.ts

453 lines
13 KiB
TypeScript
Raw Permalink Normal View History

// Copyright 2016-2020, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { PulumiCommand } from "./cmd";
import { ConfigMap, ConfigValue } from "./config";
Add removeStack options to NodeJS Auto API SDK (#16333) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> This PR adds an optional `opts` argument to the NodeJS SDK `Workspace::removeStack` method, which has `force` and `preserveConfig` optional booleans. Setting these bools to true will add their corresponding CLI flag to the command. Fixes #16332 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2024-06-14 08:35:06 +00:00
import { ListOptions, RemoveOptions } from "./localWorkspace";
import { ProjectSettings } from "./projectSettings";
import { OutputMap } from "./stack";
2020-09-08 23:20:10 +00:00
import { StackSettings } from "./stackSettings";
import { TagMap } from "./tag";
2020-09-08 23:20:10 +00:00
2020-10-07 07:25:36 +00:00
/**
* {@link Workspace} is the execution context containing a single Pulumi
* project, a program, and multiple {@link Stack}s. Workspaces are used to
* manage the execution environment, providing various utilities such as plugin
* installation, environment configuration (`$PULUMI_HOME`), and creation,
* deletion, and listing of Stacks.
2020-10-07 07:25:36 +00:00
*
* @alpha
*/
2020-09-14 03:28:24 +00:00
export interface Workspace {
2020-10-07 07:25:36 +00:00
/**
* The working directory to run Pulumi CLI commands.
2020-10-07 07:25:36 +00:00
*/
readonly workDir: string;
2020-10-07 07:25:36 +00:00
/**
* The directory override for CLI metadata if set. This customizes the
* location of `$PULUMI_HOME` where metadata is stored and plugins are
* installed.
2020-10-07 07:25:36 +00:00
*/
readonly pulumiHome?: string;
2020-10-07 07:25:36 +00:00
/**
* The secrets provider to use for encryption and decryption of stack
* secrets.
*
* @see https://www.pulumi.com/docs/intro/concepts/secrets/#available-encryption-providers
2020-10-07 07:25:36 +00:00
*/
readonly secretsProvider?: string;
/**
* The version of the underlying Pulumi CLI/engine.
*/
readonly pulumiVersion: string;
/**
* The underlying Pulumi CLI.
*/
readonly pulumiCommand: PulumiCommand;
2020-10-07 07:25:36 +00:00
/**
* The inline program {@link PulumiFn} to be used for preview/update
* operations, if any. If none is specified, the stack will refer to {@link
* ProjectSettings} for this information.
2020-10-07 07:25:36 +00:00
*/
program?: PulumiFn;
2020-10-07 07:25:36 +00:00
/**
* Environment values scoped to the current workspace. These will be
* supplied to every Pulumi command.
2020-10-07 07:25:36 +00:00
*/
envVars: { [key: string]: string };
2020-10-07 07:25:36 +00:00
/**
* Returns the settings object for the current project, if any.
2020-10-07 07:25:36 +00:00
*/
projectSettings(): Promise<ProjectSettings>;
2020-10-07 07:25:36 +00:00
/**
* Overwrites the settings object in the current project. There can only be
* a single project per workspace. Fails if the new project name does not
* match the old one.
2020-10-07 07:25:36 +00:00
*
* @param settings
* The settings object to save.
2020-10-07 07:25:36 +00:00
*/
saveProjectSettings(settings: ProjectSettings): Promise<void>;
2020-10-07 07:25:36 +00:00
/**
* Returns the settings object for the stack matching the specified stack
* name, if any.
2020-10-07 07:25:36 +00:00
*
* @param stackName
* The name of the stack.
2020-10-07 07:25:36 +00:00
*/
stackSettings(stackName: string): Promise<StackSettings>;
2020-10-07 07:25:36 +00:00
/**
* Overwrites the settings object for the stack matching the specified stack
* name.
2020-10-07 07:25:36 +00:00
*
* @param stackName
* The name of the stack to operate on.
* @param settings
* The settings object to save.
2020-10-07 07:25:36 +00:00
*/
saveStackSettings(stackName: string, settings: StackSettings): Promise<void>;
2020-10-07 07:25:36 +00:00
/**
* A hook to provide additional arguments to every CLI command before they
* are executed. Provided with the stack name, this should return a list of
* arguments to append to an invoked command (e.g. `["--config=...", ...]`).
2020-10-07 07:25:36 +00:00
*/
2020-09-19 21:40:23 +00:00
serializeArgsForOp(stackName: string): Promise<string[]>;
2020-10-07 07:25:36 +00:00
/**
* A hook executed after every command. Called with the stack name. An
* extensibility point to perform workspace cleanup (CLI operations may
* create/modify a `Pulumi.stack.yaml`)
2020-10-07 07:25:36 +00:00
*/
2020-09-19 21:40:23 +00:00
postCommandCallback(stackName: string): Promise<void>;
[Automation API / Nodejs] - Environment functions (#14788) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Add nodejs automation API support for adding and removing environments for stack configuration. Fixes https://github.com/pulumi/pulumi/issues/14795 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-12-11 16:14:10 +00:00
/**
* Adds environments to the end of a stack's import list. Imported
* environments are merged in order per the ESC merge rules. The list of
* environments behaves as if it were the import list in an anonymous
[Automation API / Nodejs] - Environment functions (#14788) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Add nodejs automation API support for adding and removing environments for stack configuration. Fixes https://github.com/pulumi/pulumi/issues/14795 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-12-11 16:14:10 +00:00
* environment.
*
* @param stackName
* The stack to operate on
* @param environments
* The names of the environments to add to the stack's configuration
[Automation API / Nodejs] - Environment functions (#14788) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Add nodejs automation API support for adding and removing environments for stack configuration. Fixes https://github.com/pulumi/pulumi/issues/14795 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-12-11 16:14:10 +00:00
*/
addEnvironments(stackName: string, ...environments: string[]): Promise<void>;
Automation API support for listing environments (#14995) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Automation API support for `pulumi config env ls` Fixes https://github.com/pulumi/pulumi/issues/14797 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-12-22 05:18:14 +00:00
/**
* Returns the list of environments associated with the specified stack
* name.
Automation API support for listing environments (#14995) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Automation API support for `pulumi config env ls` Fixes https://github.com/pulumi/pulumi/issues/14797 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-12-22 05:18:14 +00:00
*
* @param stackName
* The stack to operate on
Automation API support for listing environments (#14995) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Automation API support for `pulumi config env ls` Fixes https://github.com/pulumi/pulumi/issues/14797 ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-12-22 05:18:14 +00:00
*/
listEnvironments(stackName: string): Promise<string[]>;
[Automation API / Nodejs] - Environment functions (#14788) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Add nodejs automation API support for adding and removing environments for stack configuration. Fixes https://github.com/pulumi/pulumi/issues/14795 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-12-11 16:14:10 +00:00
/**
* Removes an environment from a stack's import list.
*
* @param stackName
* The stack to operate on
* @param environment
* The name of the environment to remove from the stack's configuration
[Automation API / Nodejs] - Environment functions (#14788) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Add nodejs automation API support for adding and removing environments for stack configuration. Fixes https://github.com/pulumi/pulumi/issues/14795 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-12-11 16:14:10 +00:00
*/
removeEnvironment(stackName: string, environment: string): Promise<void>;
2020-10-07 07:25:36 +00:00
/**
* Returns the value associated with the specified stack name and key,
* scoped to the Workspace.
*
* @param stackName
* The stack to read config from
* @param key
* The key to use for the config lookup
* @param path
* The key contains a path to a property in a map or list to get
2020-10-07 07:25:36 +00:00
*/
getConfig(stackName: string, key: string, path?: boolean): Promise<ConfigValue>;
2020-10-07 07:25:36 +00:00
/**
* Returns the config map for the specified stack name, scoped to the
* current Workspace.
2020-10-07 07:25:36 +00:00
*
* @param stackName
* The stack to read config from
2020-10-07 07:25:36 +00:00
*/
getAllConfig(stackName: string): Promise<ConfigMap>;
2020-10-07 07:25:36 +00:00
/**
* Sets the specified key-value pair on the provided stack name.
*
* @param stackName
* The stack to operate on
* @param key
* The config key to set
* @param value
* The value to set
* @param path
* The key contains a path to a property in a map or list to set
2020-10-07 07:25:36 +00:00
*/
setConfig(stackName: string, key: string, value: ConfigValue, path?: boolean): Promise<void>;
2020-10-07 07:25:36 +00:00
/**
* Sets all values in the provided config map for the specified stack name.
*
* @param stackName
* The stack to operate on
* @param config
* The {@link ConfigMap} to upsert against the existing config
* @param path
* The keys contain a path to a property in a map or list to set
2020-10-07 07:25:36 +00:00
*/
setAllConfig(stackName: string, config: ConfigMap, path?: boolean): Promise<void>;
2020-10-07 07:25:36 +00:00
/**
* Removes the specified key-value pair on the provided stack name.
*
* @param stackName
* The stack to operate on
* @param key
* The config key to remove
* @param path
* The key contains a path to a property in a map or list to remove
2020-10-07 07:25:36 +00:00
*/
removeConfig(stackName: string, key: string, path?: boolean): Promise<void>;
2020-10-07 07:25:36 +00:00
/**
* Removes all values in the provided key list for the specified stack name.
*
* @param stackName
* The stack to operate on
* @param keys
* The list of keys to remove from the underlying config
* @param path
* The keys contain a path to a property in a map or list to remove
2020-10-07 07:25:36 +00:00
*/
removeAllConfig(stackName: string, keys: string[], path?: boolean): Promise<void>;
2020-10-07 07:25:36 +00:00
/**
* Gets and sets the config map used with the last update for Stack matching
* stack name.
2020-10-07 07:25:36 +00:00
*
* @param stackName
* The stack to refresh
2020-10-07 07:25:36 +00:00
*/
refreshConfig(stackName: string): Promise<ConfigMap>;
/**
* Returns the value associated with the specified stack name and key,
* scoped to the {@link Workspace}.
*
* @param stackName
* The stack to read tag metadata from.
* @param key
* The key to use for the tag lookup.
*/
getTag(stackName: string, key: string): Promise<string>;
/**
* Sets the specified key-value pair on the provided stack name.
*
* @param stackName
* The stack to operate on.
* @param key
* The tag key to set.
* @param value
* The tag value to set.
*/
setTag(stackName: string, key: string, value: string): Promise<void>;
/**
* Removes the specified key-value pair on the provided stack name.
*
* @param stackName
* The stack to operate on.
* @param key
* The tag key to remove.
*/
removeTag(stackName: string, key: string): Promise<void>;
/**
* Returns the tag map for the specified tag name, scoped to the current
* {@link Workspace.}
*
* @param stackName
* The stack to read tag metadata from.
*/
listTags(stackName: string): Promise<TagMap>;
2020-10-07 07:25:36 +00:00
/**
* Returns information about the currently authenticated user.
2020-10-07 07:25:36 +00:00
*/
whoAmI(): Promise<WhoAmIResult>;
2020-10-07 07:25:36 +00:00
/**
* Returns a summary of the currently selected stack, if any.
*/
stack(): Promise<StackSummary | undefined>;
2020-10-07 07:25:36 +00:00
/**
* Creates and sets a new stack with the stack name, failing if one already
* exists.
2020-10-07 07:25:36 +00:00
*
* @param stackName
* The stack to create.
2020-10-07 07:25:36 +00:00
*/
createStack(stackName: string): Promise<void>;
2020-10-07 07:25:36 +00:00
/**
* Selects and sets an existing stack matching the stack name, failing if
* none exists.
2020-10-07 07:25:36 +00:00
*
* @param stackName
* The stack to select.
2020-10-07 07:25:36 +00:00
*/
selectStack(stackName: string): Promise<void>;
2020-10-07 07:25:36 +00:00
/**
* Deletes the stack and all associated configuration and history.
*
* @param stackName
* The stack to remove
2020-10-07 07:25:36 +00:00
*/
Add removeStack options to NodeJS Auto API SDK (#16333) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> This PR adds an optional `opts` argument to the NodeJS SDK `Workspace::removeStack` method, which has `force` and `preserveConfig` optional booleans. Setting these bools to true will add their corresponding CLI flag to the command. Fixes #16332 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2024-06-14 08:35:06 +00:00
removeStack(stackName: string, opts?: RemoveOptions): Promise<void>;
2020-10-07 07:25:36 +00:00
/**
* Returns all stacks from the underlying backend based on the provided
* options. This queries backend and may return stacks not present in the
* {@link Workspace} as `Pulumi.<stack>.yaml` files.
Add support for `--all` parameter of the `stack ls` command to the Automation API (#16266) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description Adds Go/Nodejs/Python automation API support for pulumi stack ls --all. Fixes: [#14226](https://github.com/pulumi/pulumi/issues/14226) ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. --> --------- Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
2024-06-03 15:53:43 +00:00
*
* @param opts
* Options to customize the behavior of the list.
2020-10-07 07:25:36 +00:00
*/
Add support for `--all` parameter of the `stack ls` command to the Automation API (#16266) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description Adds Go/Nodejs/Python automation API support for pulumi stack ls --all. Fixes: [#14226](https://github.com/pulumi/pulumi/issues/14226) ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. --> --------- Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
2024-06-03 15:53:43 +00:00
listStacks(opts?: ListOptions): Promise<StackSummary[]>;
/**
* Installs a plugin in the workspace, for example to use cloud providers
* like AWS or GCP.
*
* @param name
* The name of the plugin.
* @param version
* The version of the plugin e.g. "v1.0.0".
* @param server
* The server to install the plugin into
*/
installPluginFromServer(name: string, version: string, server: string): Promise<void>;
/**
* Installs a plugin in the workspace from a remote server, for example a
* third-party plugin.
*
* @param name
* The name of the plugin.
* @param version
* The version of the plugin e.g. "v1.0.0".
* @param kind
* The kind of plugin e.g. "resource"
*/
2022-10-21 23:51:19 +00:00
installPlugin(name: string, version: string, kind?: string): Promise<void>;
/**
* Removes a plugin from the workspace matching the specified name and
* version.
*
* @param name
* The optional name of the plugin.
* @param versionRange
* An optional semver range to check when removing plugins matching the
* given name e.g. "1.0.0", ">1.0.0".
* @param kind
* The kind of plugin e.g. "resource"
*/
removePlugin(name?: string, versionRange?: string, kind?: string): Promise<void>;
/**
* Returns a list of all plugins installed in the workspace.
*/
listPlugins(): Promise<PluginInfo[]>;
/**
* Exports the deployment state of the stack. This can be combined with
* {@link Workspace.importStack} to edit a stack's state (such as recovery
* from failed deployments).
*
* @param stackName the name of the stack.
*/
exportStack(stackName: string): Promise<Deployment>;
/**
* Imports the specified deployment state into a pre-existing stack. This
* can be combined with {@link Workspace.exportStack} to edit a stack's
* state (such as recovery from failed deployments).
*
* @param stackName
* The name of the stack.
* @param state
* The stack state to import.
*/
importStack(stackName: string, state: Deployment): Promise<void>;
/**
* Gets the current set of Stack outputs from the last {@link Stack.up}.
*
* @param stackName
* The name of the stack.
*/
stackOutputs(stackName: string): Promise<OutputMap>;
2020-09-14 03:28:24 +00:00
}
2020-10-07 07:25:36 +00:00
/**
* A summary of the status of a given stack.
*/
export interface StackSummary {
name: string;
current: boolean;
lastUpdate?: string;
stack ls: remove misleading updateInProgress output for file backend (#14309) File backends currently do not support indicating whether an operation is currently in progress or not. In the `stack ls --json` output we always end up with a "updateInProgress = false" field, even when an update is in progress. This is misleading. Disable showing this erroneous and misleading output. Fixes #10677 Based on Luke's comments in that issue, I believe we should merge this as bug fix for the issue, and then open a separate feature request tracking the implementation of tracking whether an update is in progress in the file backend. ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-10-27 07:33:07 +00:00
updateInProgress?: boolean;
resourceCount?: number;
url?: string;
}
/**
* Deployment encapsulates the state of a stack deployment.
*/
export interface Deployment {
/**
* Version indicates the schema of the encoded deployment.
*/
version: number;
/**
* The pulumi deployment.
*/
// TODO: Expand type to encapsulate deployment.
deployment: any;
}
2020-10-07 07:25:36 +00:00
/**
* A Pulumi program as an inline function (in process).
*/
export type PulumiFn = () => Promise<Record<string, any> | void>;
2020-10-07 07:25:36 +00:00
/**
* The currently logged-in Pulumi identity.
*/
export interface WhoAmIResult {
user: string;
url?: string;
organizations?: string[];
}
export interface PluginInfo {
name: string;
path: string;
kind: PluginKind;
version?: string;
size: number;
installTime: Date;
lastUsedTime: Date;
serverURL: string;
}
export type PluginKind = "analyzer" | "language" | "resource";