client

package
v0.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 21 Imported by: 5

Documentation

Overview

Package client implements a client for the Pulumi Service HTTP/REST API. Important note: This client is not versioned, and not intended for external use at this time.

Index

Constants

View Source
const DefaultProject = "default"

Variables

This section is empty.

Functions

func DiagnosticsHaveErrors added in v0.24.0

func DiagnosticsHaveErrors(diags []EnvironmentDiagnostic) bool

func IsNotFound added in v0.9.0

func IsNotFound(err error) bool

IsNotFound returns true if the indicated error is a "not found" error.

Types

type CheckEnvironmentResponse

type CheckEnvironmentResponse struct {
	Diagnostics []EnvironmentDiagnostic `json:"diagnostics,omitempty"`
}

type CheckYAMLOption added in v0.10.0

type CheckYAMLOption struct {
	ShowSecrets bool
}

type Client

type Client interface {
	// Insecure returns true if this client is insecure (i.e. has TLS disabled).
	Insecure() bool

	// URL returns the URL of the API endpoint this client interacts with
	URL() string

	// GetPulumiAccountDetails returns the user implied by the API token associated with this client.
	GetPulumiAccountDetails(ctx context.Context) (string, []string, *workspace.TokenInformation, error)

	// GetRevisionNumber returns the revision number for version.
	GetRevisionNumber(ctx context.Context, orgName, projectName, envName, version string) (int, error)

	// GetDefaultOrg returns the organization if the backend has an opinion on what user organization to default to,
	// if not configured locally by the user.
	GetDefaultOrg(ctx context.Context) (string, error)

	// ListEnvironments lists all environments that are accessible to the calling user.
	//
	// Each call to ListEnvironments returns a page of results and a continuation token. If there are no
	// more results, the continuation token will be empty. Otherwise, the continuattion token should be
	// passed to the next call to ListEnvironments to fetch the next page of results.
	ListEnvironments(
		ctx context.Context,
		continuationToken string,
	) (environments []OrgEnvironment, nextToken string, err error)

	// ListOrganizationEnvironments lists all environments in the given org that are accessible to the calling user.
	//
	// Each call to ListOrganizationEnvironments returns a page of results and a continuation token. If there are no
	// more results, the continuation token will be empty. Otherwise, the continuattion token should be
	// passed to the next call to ListOrganizationEnvironments to fetch the next page of results.
	ListOrganizationEnvironments(
		ctx context.Context,
		orgName string,
		continuationToken string,
	) (environments []OrgEnvironment, nextToken string, err error)

	// Deprecated: Use CreateEnvironmentWithProject instead
	CreateEnvironment(ctx context.Context, orgName, envName string) error

	// CreateEnvironment creates an environment named projectName/envName in orgName.
	CreateEnvironmentWithProject(ctx context.Context, orgName, projectName, envName string) error

	// CloneEnvironment clones an source environment into a new destination environment.
	CloneEnvironment(ctx context.Context, orgName, srcEnvProject, srcEnvName string, destEnv CloneEnvironmentRequest) error

	// GetEnvironment returns the YAML + ETag for the environment envName in org orgName. If decrypt is
	// true, any { fn::secret: { ciphertext: "..." } } constructs in the definition will be decrypted and
	// replaced with { fn::secret: "plaintext" }.
	//
	// The etag returned by GetEnvironment can be passed to UpdateEnvironment in order to avoid RMW issues
	// when editing envirionments.
	GetEnvironment(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		version string,
		decrypt bool,
	) (yaml []byte, etag string, revision int, err error)

	// GetEnvironmentDraft returns the YAML + ETag for the draft env specified.
	//
	// The returned etag  must be passed to UpdateEnvironmentDraft in order to avoid RMW issues
	// when editing drafts.
	GetEnvironmentDraft(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		changeRequestID string,
	) (yaml []byte, etag string, err error)

	// UpdateEnvironmentWithRevision updates the YAML for the environment envName in org orgName.
	//
	// If the new environment definition contains errors, the update will fail with diagnostics.
	//
	// If etag is not the empty string and the environment's current etag does not match the provided etag
	// (i.e. because a different entity has called UpdateEnvironment), the update will fail with a 409
	// error.
	UpdateEnvironmentWithRevision(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		yaml []byte,
		etag string,
	) ([]EnvironmentDiagnostic, int, error)

	// Deprecated: Use UpdateEnvironmentWithProject instead
	UpdateEnvironment(
		ctx context.Context,
		orgName string,
		envName string,
		yaml []byte,
		etag string,
	) ([]EnvironmentDiagnostic, error)
	// This method has a legacy signature, please use UpdateEnvironmentWithRevision instead
	// Remove this method once circular dependency between esc and pulumi/pulumi is resolved
	UpdateEnvironmentWithProject(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		yaml []byte,
		etag string,
	) ([]EnvironmentDiagnostic, error)

	// CreateEnvironmentDraft creates a draft update of the YAML for the environment envName in org orgName.
	// The resulting ChangeRequestID is returned.
	//
	// If the new environment definition contains errors, the creation will fail with diagnostics.
	//
	// If etag is not the empty string and the environment's current etag does not match the provided etag
	// (i.e. because a different entity has called UpdateEnvironment), the creation will fail with a 409
	// error.
	CreateEnvironmentDraft(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		yaml []byte,
		etag string,
	) (string, []EnvironmentDiagnostic, error)

	// UpdateEnvironmentDraft updates a draft for the environment envName in org orgName.
	//
	// If the updated environment definition contains errors, the creation will fail with diagnostics.
	//
	// If the draft's current etag does not match the provided etag (i.e. because a different entity
	// has called UpdateEnvironment), the creation will fail with a 409 error.
	UpdateEnvironmentDraft(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		changeRequestID string,
		yaml []byte,
		etag string,
	) ([]EnvironmentDiagnostic, error)

	// SubmitChangeRequest submits the change request with the specified ID in org orgName.
	// Optionally provide a description for the change request.
	SubmitChangeRequest(
		ctx context.Context,
		orgName string,
		changeRequestID string,
		description *string,
	) error

	// DeleteEnvironment deletes the environment envName in org orgName.
	DeleteEnvironment(ctx context.Context, orgName, projectName, envName string) error

	// OpenEnvironment evaluates the environment projectName/envName in org orgName and returns the ID of the opened
	// environment. The opened environment will be available for the indicated duration, after which it
	// will expire.
	//
	// If the environment contains errors, the open will fail with diagnostics.
	OpenEnvironment(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		version string,
		duration time.Duration,
	) (string, []EnvironmentDiagnostic, error)

	// OpenEnvironmentDraft evaluates the environment draft and returns the ID of the opened
	// environment. The opened environment will be available for the indicated duration, after which it
	// will expire.
	//
	// If the environment draft contains errors, the open will fail with diagnostics.
	OpenEnvironmentDraft(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		changeRequestID string,
		duration time.Duration,
	) (string, []EnvironmentDiagnostic, error)

	// RotateEnvironment will rotate credentials in an environment.
	// If rotationPaths is non-empty, will only rotate credentials at those paths.
	RotateEnvironment(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		rotationPaths []string,
	) (*RotateEnvironmentResponse, []EnvironmentDiagnostic, error)

	// CheckYAMLEnvironment checks the given environment YAML for errors within the context of org orgName.
	//
	// This call returns the checked environment's AST, values, schema, and any diagnostics issued by the
	// evaluator.
	CheckYAMLEnvironment(
		ctx context.Context,
		orgName string,
		yaml []byte,
		opts ...CheckYAMLOption,
	) (*esc.Environment, []EnvironmentDiagnostic, error)

	// OpenYAMLEnvironment evaluates the given environment YAML within the context of org orgName and
	// returns the ID of the opened environment. The opened environment will be available for the indicated
	// duration, after which it will expire.
	//
	// If the environment contains errors, the open will fail with diagnostics.
	OpenYAMLEnvironment(
		ctx context.Context,
		orgName string,
		yaml []byte,
		duration time.Duration,
	) (string, []EnvironmentDiagnostic, error)

	// Deprecated: Use GetOpenEnvironmentWithProject instead
	GetOpenEnvironment(ctx context.Context, orgName, envName, openEnvID string) (*esc.Environment, error)
	// GetOpenEnvironmentWithProject returns the AST, values, and schema for the open environment with ID openEnvID in
	// environment envName and org orgName.
	GetOpenEnvironmentWithProject(ctx context.Context, orgName, projectName, envName, openEnvID string) (*esc.Environment, error)

	// GetAnonymousOpenEnvironment returns the AST, values, and schema for the open environment with ID openEnvID in
	// an anonymous environment.
	GetAnonymousOpenEnvironment(ctx context.Context, orgName, openEnvID string) (*esc.Environment, error)

	// GetOpenProperty returns the value of a single property in the open environment with ID openEnvID in
	// environment envName and org orgName.
	//
	// The property parameter is a Pulumi property path. Property paths may contain dotted accessors and
	// numeric or string subscripts. For example:
	//
	//     foo.bar[0]["baz"]
	//     aws.login
	//     environmentVariables["AWS_ACCESS_KEY_ID"]
	//
	GetOpenProperty(ctx context.Context, orgName, projectName, envName, openEnvID, property string) (*esc.Value, error)

	// GetOpenProperty returns the value of a single property in the open environment with ID openEnvID in
	// an anonymous environment.
	GetAnonymousOpenProperty(ctx context.Context, orgName, openEnvID, property string) (*esc.Value, error)

	// ListEnvironmentTags lists the tags for the given environment.
	ListEnvironmentTags(
		ctx context.Context,
		orgName, projectName, envName string,
		options ListEnvironmentTagsOptions,
	) ([]*EnvironmentTag, string, error)

	// ListEnvironmentReferrers lists entities (other environments, stacks, and Insights accounts) that
	// reference the given environment.
	ListEnvironmentReferrers(
		ctx context.Context,
		orgName, projectName, envName string,
		options ListEnvironmentReferrersOptions,
	) (*ListEnvironmentReferrersResponse, error)

	// CreateEnvironmentTag creates and applies a tag to the given environment.
	CreateEnvironmentTag(
		ctx context.Context,
		orgName, projectName, envName, key, value string,
	) (*EnvironmentTag, error)

	// GetEnvironmentTag returns a tag with the specified name for the given environment.
	GetEnvironmentTag(
		ctx context.Context,
		orgName, projectName, envName, key string,
	) (*EnvironmentTag, error)

	// UpdateEnvironmentTag updates a specified environment tag with a new key / value.
	UpdateEnvironmentTag(
		ctx context.Context,
		orgName, projectName, envName, currentKey, currentValue, newKey, newValue string,
	) (*EnvironmentTag, error)

	// DeleteEnvironmentTag deletes a specified tag on an environment.
	DeleteEnvironmentTag(ctx context.Context, orgName, projectName, envName, tagName string) error

	// ListEnvironmentWebhooks lists the webhooks attached to the given environment.
	ListEnvironmentWebhooks(
		ctx context.Context,
		orgName, projectName, envName string,
	) ([]EnvironmentWebhook, error)

	// GetEnvironmentWebhook returns the named webhook for the given environment.
	GetEnvironmentWebhook(
		ctx context.Context,
		orgName, projectName, envName, webhookName string,
	) (*EnvironmentWebhook, error)

	// CreateEnvironmentWebhook creates a new webhook on the given environment.
	CreateEnvironmentWebhook(
		ctx context.Context,
		orgName, projectName, envName string,
		req CreateEnvironmentWebhookRequest,
	) (*EnvironmentWebhook, error)

	// UpdateEnvironmentWebhook updates the named webhook on the given environment.
	UpdateEnvironmentWebhook(
		ctx context.Context,
		orgName, projectName, envName, webhookName string,
		req UpdateEnvironmentWebhookRequest,
	) (*EnvironmentWebhook, error)

	// DeleteEnvironmentWebhook deletes the named webhook from the given environment.
	DeleteEnvironmentWebhook(
		ctx context.Context,
		orgName, projectName, envName, webhookName string,
	) error

	// PingEnvironmentWebhook sends a synthetic delivery to the named webhook and returns the result.
	PingEnvironmentWebhook(
		ctx context.Context,
		orgName, projectName, envName, webhookName string,
	) (*EnvironmentWebhookDelivery, error)

	// ListEnvironmentWebhookDeliveries lists the deliveries for the named webhook.
	ListEnvironmentWebhookDeliveries(
		ctx context.Context,
		orgName, projectName, envName, webhookName string,
	) ([]EnvironmentWebhookDelivery, error)

	// ListEnvironmentSchedules lists the scheduled actions for the given environment.
	ListEnvironmentSchedules(
		ctx context.Context,
		orgName, projectName, envName string,
	) (*ListScheduledActionsResponse, error)

	// CreateEnvironmentSchedule creates a new scheduled action on the given environment.
	CreateEnvironmentSchedule(
		ctx context.Context,
		orgName, projectName, envName string,
		req CreateEnvironmentScheduleRequest,
	) (*ScheduledAction, error)

	// GetEnvironmentSchedule returns the scheduled action with the given ID.
	GetEnvironmentSchedule(
		ctx context.Context,
		orgName, projectName, envName, scheduleID string,
	) (*ScheduledAction, error)

	// UpdateEnvironmentSchedule edits the scheduled action with the given ID.
	UpdateEnvironmentSchedule(
		ctx context.Context,
		orgName, projectName, envName, scheduleID string,
		req UpdateEnvironmentScheduleRequest,
	) (*ScheduledAction, error)

	// DeleteEnvironmentSchedule deletes the scheduled action with the given ID.
	DeleteEnvironmentSchedule(ctx context.Context, orgName, projectName, envName, scheduleID string) error

	// ListEnvironmentScheduleHistory lists past executions of the scheduled action with the given ID.
	ListEnvironmentScheduleHistory(
		ctx context.Context,
		orgName, projectName, envName, scheduleID string,
	) (*ListScheduleHistoryResponse, error)

	// GetEnvironmentRevision returns a description of the given revision.
	GetEnvironmentRevision(ctx context.Context, orgName, projectName, envName string, revision int) (*EnvironmentRevision, error)

	// ListEnvironmentRevisions returns a list of revisions to the named environments in reverse order by
	// revision number. The revision at which to start and the number of revisions to return are
	// configurable via the options parameter.
	ListEnvironmentRevisions(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		options ListEnvironmentRevisionsOptions,
	) ([]EnvironmentRevision, error)

	// RetractEnvironmentRevision retracts a specific revision of an environment.
	RetractEnvironmentRevision(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		version string,
		replacement *int,
		reason string,
	) error

	// CreateEnvironmentRevisionTag creates a new revision tag with the given name.
	CreateEnvironmentRevisionTag(ctx context.Context, orgName, projectName, envName, tagName string, revision *int) error

	// GetEnvironmentRevisionTag returns a description of the given revision tag.
	GetEnvironmentRevisionTag(ctx context.Context, orgName, projectName, envName, tagName string) (*EnvironmentRevisionTag, error)

	// UpdateEnvironmentRevisionTag updates the revision tag with the given name.
	UpdateEnvironmentRevisionTag(ctx context.Context, orgName, projectName, envName, tagName string, revision *int) error

	// DeleteEnvironmentRevisionTag deletes the revision tag with the given name.
	DeleteEnvironmentRevisionTag(ctx context.Context, orgName, projectName, envName, tagName string) error

	// ListEnvironmentRevisionTags lists the revision tags for the given environment.
	ListEnvironmentRevisionTags(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		options ListEnvironmentRevisionTagsOptions,
	) ([]EnvironmentRevisionTag, error)

	// EnvironmentExists checks if the specified environment exists.
	EnvironmentExists(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
	) (exists bool, err error)

	// CreateEnvironmentOpenRequest creates a request for opening a protected environment.
	CreateEnvironmentOpenRequest(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		grantExpirationSeconds int,
		accessDurationSeconds int,
	) (*CreateEnvironmentOpenRequestResponse, error)

	// GetEnvironmentSettings returns settings for the given environment.
	GetEnvironmentSettings(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
	) (*EnvironmentSettings, error)

	// PatchEnvironmentSettings updates settings for the given environment.
	PatchEnvironmentSettings(
		ctx context.Context,
		orgName string,
		projectName string,
		envName string,
		req PatchEnvironmentSettingsRequest,
	) error
}

Client provides a slim wrapper around the Pulumi HTTP/REST API.

NOTE: this is not considered a public API, and we reserve the right to make breaking changes, including adding parameters, removing methods, changing types, etc.

However, there is currently a cyclic dependency between the Pulumi CLI and the ESC CLI that causes breaking changes to any part of the client API to break the ESC CLI build. So we're limited to non-breaking changes, including adding variadic args or adding additional methods.

func New

func New(userAgent, apiURL, apiToken string, insecure bool) Client

New creates a new Pulumi API client with the given URL and API token.

func NewDefaultClient added in v0.8.2

func NewDefaultClient(apiToken string) Client

New creates a new Pulumi API client with the given URL and API token.

type CloneEnvironmentRequest added in v0.10.0

type CloneEnvironmentRequest struct {
	Project                 string `json:"project,omitempty"`
	Name                    string `json:"name"`
	Version                 int    `json:"version,omitempty"`
	PreserveHistory         bool   `json:"preserveHistory,omitempty"`
	PreserveAccess          bool   `json:"preserveAccess,omitempty"`
	PreserveEnvironmentTags bool   `json:"preserveEnvironmentTags,omitempty"`
	PreserveRevisionTags    bool   `json:"preserveRevisionTags,omitempty"`
}

type CreateEnvironmentDraftResponse added in v0.15.0

type CreateEnvironmentDraftResponse struct {
	ChangeRequestID      string `json:"changeRequestId"`
	LatestRevisionNumber int    `json:"latestRevisionNumber"`
}

type CreateEnvironmentOpenRequestResponse added in v0.19.0

type CreateEnvironmentOpenRequestResponse struct {
	ChangeRequests []EnvironmentOpenRequestChangeRequest `json:"changeRequests"`
}

type CreateEnvironmentRevisionTagRequest added in v0.9.0

type CreateEnvironmentRevisionTagRequest struct {
	Name     string `json:"name"`
	Revision *int   `json:"revision,omitempty"`
}

type CreateEnvironmentScheduleRequest added in v0.24.0

type CreateEnvironmentScheduleRequest struct {
	ScheduleCron          string                                          `json:"scheduleCron,omitempty"`
	ScheduleOnce          string                                          `json:"scheduleOnce,omitempty"`
	SecretRotationRequest *CreateEnvironmentSecretRotationScheduleRequest `json:"secretRotationRequest,omitempty"`
}

CreateEnvironmentScheduleRequest is the request body for creating a scheduled action on an environment. Exactly one of ScheduleCron or ScheduleOnce should be set.

type CreateEnvironmentSecretRotationScheduleRequest added in v0.24.0

type CreateEnvironmentSecretRotationScheduleRequest struct {
	EnvironmentPath string `json:"environmentPath"`
}

CreateEnvironmentSecretRotationScheduleRequest is the secret-rotation-specific payload for CreateEnvironmentScheduleRequest. An empty EnvironmentPath means rotate the whole environment.

type CreateEnvironmentTagRequest added in v0.10.0

type CreateEnvironmentTagRequest = TagRequest

type CreateEnvironmentWebhookRequest added in v0.24.0

type CreateEnvironmentWebhookRequest struct {
	Active           bool     `json:"active"`
	DisplayName      string   `json:"displayName"`
	Name             string   `json:"name"`
	OrganizationName string   `json:"organizationName"`
	ProjectName      string   `json:"projectName,omitempty"`
	EnvName          string   `json:"envName,omitempty"`
	PayloadURL       string   `json:"payloadUrl"`
	Filters          []string `json:"filters,omitempty"`
	Groups           []string `json:"groups,omitempty"`
	Format           string   `json:"format,omitempty"`
	Secret           string   `json:"secret,omitempty"`
}

CreateEnvironmentWebhookRequest is the request body for creating a webhook on an environment. OrganizationName, ProjectName, and EnvName must match the URL path or the service returns 400.

type EnvironmentDiagnostic

type EnvironmentDiagnostic struct {
	Range    *esc.Range                    `json:"range,omitempty"`
	Summary  string                        `json:"summary,omitempty"`
	Detail   string                        `json:"detail,omitempty"`
	Severity EnvironmentDiagnosticSeverity `json:"severity,omitempty"`
}

func (EnvironmentDiagnostic) IsError added in v0.24.0

func (d EnvironmentDiagnostic) IsError() bool

type EnvironmentDiagnosticError

type EnvironmentDiagnosticError struct {
	Diagnostics []EnvironmentDiagnostic `json:"diagnostics,omitempty"`
}

func (EnvironmentDiagnosticError) Error

func (err EnvironmentDiagnosticError) Error() string

Error implements the Error interface.

type EnvironmentDiagnosticSeverity added in v0.24.0

type EnvironmentDiagnosticSeverity string
const (
	DiagError   EnvironmentDiagnosticSeverity = "error"
	DiagWarning EnvironmentDiagnosticSeverity = "warning"
)

type EnvironmentErrorResponse

type EnvironmentErrorResponse struct {
	Code        int                     `json:"code,omitempty"`
	Message     string                  `json:"message,omitempty"`
	Diagnostics []EnvironmentDiagnostic `json:"diagnostics,omitempty"`
}

func (EnvironmentErrorResponse) Error

func (err EnvironmentErrorResponse) Error() string

type EnvironmentImportReferrer added in v0.24.0

type EnvironmentImportReferrer struct {
	Project  string `json:"project"`
	Name     string `json:"name"`
	Revision int64  `json:"revision"`
}

EnvironmentImportReferrer represents an `import` reference from another environment.

type EnvironmentInsightsAccountReferrer added in v0.24.0

type EnvironmentInsightsAccountReferrer struct {
	AccountName string `json:"accountName"`
}

EnvironmentInsightsAccountReferrer represents a reference from an Insights account.

type EnvironmentOpenRequestChangeRequest added in v0.19.0

type EnvironmentOpenRequestChangeRequest struct {
	ProjectName          string `json:"projectName"`
	EnvironmentName      string `json:"environmentName"`
	ChangeRequestID      string `json:"changeRequestId"`
	LatestRevisionNumber int    `json:"latestRevisionNumber"`
	ETag                 string `json:"etag"`
}

type EnvironmentReferrer added in v0.24.0

type EnvironmentReferrer struct {
	Environment     *EnvironmentImportReferrer          `json:"environment,omitempty"`
	Stack           *EnvironmentStackReferrer           `json:"stack,omitempty"`
	InsightsAccount *EnvironmentInsightsAccountReferrer `json:"insightsAccount,omitempty"`
}

EnvironmentReferrer represents an entity that refers to an environment. Exactly one of the pointer fields will be non-nil, indicating which kind of referrer this is.

type EnvironmentRevision added in v0.9.0

type EnvironmentRevision struct {
	Number       int       `json:"number"`
	Created      time.Time `json:"created"`
	CreatorLogin string    `json:"creatorLogin"`
	CreatorName  string    `json:"creatorName"`
	Tags         []string  `json:"tags"`

	Retracted *EnvironmentRevisionRetracted `json:"retracted,omitempty"`
}

type EnvironmentRevisionRetracted added in v0.9.1

type EnvironmentRevisionRetracted struct {
	Replacement int       `json:"replacement"`
	At          time.Time `json:"at"`
	ByLogin     string    `json:"byLogin,omitempty"`
	ByName      string    `json:"byName,omitempty"`
	Reason      string    `json:"reason,omitempty"`
}

type EnvironmentRevisionTag added in v0.9.0

type EnvironmentRevisionTag struct {
	Name        string    `json:"name"`
	Revision    int       `json:"revision"`
	Created     time.Time `json:"created"`
	Modified    time.Time `json:"modified"`
	EditorLogin string    `json:"editorLogin"`
	EditorName  string    `json:"editorName"`
}

type EnvironmentSettings added in v0.20.0

type EnvironmentSettings struct {
	DeletionProtected bool `json:"deletionProtected"`
}

type EnvironmentStackReferrer added in v0.24.0

type EnvironmentStackReferrer struct {
	Project string `json:"project"`
	Stack   string `json:"stack"`
	Version int64  `json:"version"`
}

EnvironmentStackReferrer represents a reference from an IaC stack.

type EnvironmentTag added in v0.10.0

type EnvironmentTag struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Value       string    `json:"value"`
	Created     time.Time `json:"created"`
	Modified    time.Time `json:"modified"`
	EditorLogin string    `json:"editorLogin"`
	EditorName  string    `json:"editorName"`
}

type EnvironmentWebhook added in v0.24.0

type EnvironmentWebhook struct {
	Active           bool     `json:"active"`
	DisplayName      string   `json:"displayName"`
	Name             string   `json:"name"`
	OrganizationName string   `json:"organizationName"`
	PayloadURL       string   `json:"payloadUrl"`
	EnvName          string   `json:"envName,omitempty"`
	Filters          []string `json:"filters,omitempty"`
	Format           string   `json:"format,omitempty"`
	Groups           []string `json:"groups,omitempty"`
	ProjectName      string   `json:"projectName,omitempty"`
	Secret           string   `json:"secret,omitempty"`
	StackName        string   `json:"stackName,omitempty"`
	HasSecret        bool     `json:"hasSecret,omitempty"`
	SecretCiphertext string   `json:"secretCiphertext,omitempty"`
}

EnvironmentWebhook describes a webhook attached to an environment.

type EnvironmentWebhookDelivery added in v0.24.0

type EnvironmentWebhookDelivery struct {
	ID              string `json:"id"`
	Kind            string `json:"kind"`
	Timestamp       int64  `json:"timestamp"`
	Duration        int64  `json:"duration"`
	Payload         string `json:"payload"`
	RequestURL      string `json:"requestUrl"`
	RequestHeaders  string `json:"requestHeaders"`
	ResponseCode    int64  `json:"responseCode"`
	ResponseHeaders string `json:"responseHeaders"`
	ResponseBody    string `json:"responseBody"`
}

EnvironmentWebhookDelivery describes a single webhook delivery attempt.

type GetDefaultOrganizationResponse added in v0.13.1

type GetDefaultOrganizationResponse struct {
	// Returns the organization name.
	// Can be an empty string, if the user is a member of no organizations
	Organization string `json:"gitHubLogin"`
}

GetDefaultOrganizationResponse returns the backend's opinion of which organization to default to for a given user, if a default organization has not been configured.

type ListEnvironmentReferrersOptions added in v0.24.0

type ListEnvironmentReferrersOptions struct {
	Count                  *int   `url:"count,omitempty"`
	AllRevisions           *bool  `url:"allRevisions,omitempty"`
	LatestStackVersionOnly *bool  `url:"latestStackVersionOnly,omitempty"`
	ContinuationToken      string `url:"continuationToken,omitempty"`
}

ListEnvironmentReferrersOptions controls pagination and filtering for ListEnvironmentReferrers.

type ListEnvironmentReferrersResponse added in v0.24.0

type ListEnvironmentReferrersResponse struct {
	Referrers         map[string][]EnvironmentReferrer `json:"referrers"`
	ContinuationToken string                           `json:"continuationToken,omitempty"`
}

ListEnvironmentReferrersResponse contains a list of entities that reference an environment, keyed by the revision tag of the referenced environment (e.g. "latest" or "3").

type ListEnvironmentRevisionTagsOptions added in v0.9.0

type ListEnvironmentRevisionTagsOptions struct {
	After string `url:"after"`
	Count *int   `url:"count"`
}

type ListEnvironmentRevisionTagsResponse added in v0.9.0

type ListEnvironmentRevisionTagsResponse struct {
	Tags      []EnvironmentRevisionTag `json:"tags"`
	NextToken string                   `json:"nextToken"`
}

type ListEnvironmentRevisionsOptions added in v0.9.0

type ListEnvironmentRevisionsOptions struct {
	Before *int `url:"before"`
	Count  *int `url:"count"`
}

type ListEnvironmentTagsOptions added in v0.10.0

type ListEnvironmentTagsOptions struct {
	After string `url:"after"`
	Count *int   `url:"count"`
}

type ListEnvironmentTagsResponse added in v0.10.0

type ListEnvironmentTagsResponse struct {
	Tags      map[string]*EnvironmentTag `json:"tags"`
	NextToken string                     `json:"nextToken"`
}

type ListEnvironmentsResponse

type ListEnvironmentsResponse struct {
	Environments []OrgEnvironment `json:"environments,omitempty"`
	NextToken    string           `json:"nextToken,omitempty"`
}

type ListScheduleHistoryResponse added in v0.24.0

type ListScheduleHistoryResponse struct {
	ScheduleHistoryEvents []ScheduleHistoryEvent `json:"scheduleHistoryEvents"`
}

ListScheduleHistoryResponse is the response shape for listing a schedule's execution history.

type ListScheduledActionsResponse added in v0.24.0

type ListScheduledActionsResponse struct {
	Schedules []ScheduledAction `json:"schedules"`
}

ListScheduledActionsResponse is the response shape for listing an environment's schedules.

type OpenEnvironmentResponse

type OpenEnvironmentResponse struct {
	ID          string                  `json:"id"`
	Diagnostics []EnvironmentDiagnostic `json:"diagnostics,omitempty"`
}

type OrgEnvironment

type OrgEnvironment struct {
	Organization string `json:"organization,omitempty"`
	Project      string `json:"project,omitempty"`
	Name         string `json:"name,omitempty"`
}

type PatchEnvironmentSettingsRequest added in v0.20.0

type PatchEnvironmentSettingsRequest struct {
	DeletionProtected *bool `json:"deletionProtected,omitempty"`
}

type RetractEnvironmentRevisionRequest added in v0.9.1

type RetractEnvironmentRevisionRequest struct {
	Replacement *int   `json:"replacement,omitempty"`
	Reason      string `json:"reason,omitempty"`
}

type RotateEnvironmentResponse added in v0.12.0

type RotateEnvironmentResponse struct {
	Code                int                     `json:"code,omitempty"`
	Message             string                  `json:"message,omitempty"`
	Diagnostics         []EnvironmentDiagnostic `json:"diagnostics,omitempty"`
	SecretRotationEvent SecretRotationEvent     `json:"secretRotationEvent,omitempty"`
}

type RotationEventStatus added in v0.12.0

type RotationEventStatus string
const (
	RotationEventSucceeded  RotationEventStatus = "succeeded"
	RotationEventFailed     RotationEventStatus = "failed"
	RotationEventInProgress RotationEventStatus = "in_progress"
)

type RotationStatus added in v0.12.0

type RotationStatus string
const (
	RotationSucceeded RotationStatus = "succeeded"
	RotationFailed    RotationStatus = "failed"
)

type ScheduleHistoryEvent added in v0.24.0

type ScheduleHistoryEvent struct {
	ID                string `json:"id"`
	ScheduledActionID string `json:"scheduledActionID"`
	Executed          string `json:"executed"`
	Version           int    `json:"version"`
	Result            string `json:"result"`
}

ScheduleHistoryEvent describes a single execution of a scheduled action.

type ScheduledAction added in v0.24.0

type ScheduledAction struct {
	ID            string          `json:"id"`
	OrgID         string          `json:"orgID"`
	Kind          string          `json:"kind"`
	Paused        bool            `json:"paused"`
	Created       string          `json:"created"`
	Modified      string          `json:"modified"`
	LastExecuted  string          `json:"lastExecuted"`
	NextExecution string          `json:"nextExecution"`
	Definition    json.RawMessage `json:"definition,omitempty"`
	ScheduleCron  string          `json:"scheduleCron,omitempty"`
	ScheduleOnce  string          `json:"scheduleOnce,omitempty"`
}

ScheduledAction describes a scheduled action attached to an environment.

Time fields (Created, Modified, LastExecuted, NextExecution, ScheduleOnce) are kept as raw ISO 8601 strings on the wire; callers can parse them as needed.

type SecretRotation added in v0.12.0

type SecretRotation struct {
	ID              string         `json:"id"`
	EnvironmentPath string         `json:"environmentPath"`
	Status          RotationStatus `json:"status"`
	ErrorMessage    *string        `json:"errorMessage,omitempty"`
}

type SecretRotationEvent added in v0.12.0

type SecretRotationEvent struct {
	ID                   string              `json:"id"`
	EnvironmentID        string              `json:"environmentId"`
	CreatedAt            time.Time           `json:"created"`
	PreRotationRevision  int                 `json:"preRotationRevision"`
	PostRotationRevision *int                `json:"postRotationRevision,omitempty"`
	UserID               string              `json:"userID"`
	CompletedAt          *time.Time          `json:"completed,omitempty"`
	Status               RotationEventStatus `json:"status"`
	ScheduledActionID    *string             `json:"scheduledActionID,omitempty"`
	ErrorMessage         *string             `json:"errorMessage,omitempty"`
	Rotations            []SecretRotation    `json:"rotations"`
}

type SubmitChangeRequestRequest added in v0.15.0

type SubmitChangeRequestRequest struct {
	Description *string `json:"description,omitempty"`
}

type TagRequest added in v0.10.0

type TagRequest struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type UpdateEnvironmentDraftResponse added in v0.16.0

type UpdateEnvironmentDraftResponse struct {
	ChangeRequestID      string `json:"changeRequestId"`
	LatestRevisionNumber int    `json:"latestRevisionNumber"`
}

type UpdateEnvironmentResponse

type UpdateEnvironmentResponse struct {
	EnvironmentDiagnosticError
}

type UpdateEnvironmentRevisionTagRequest added in v0.9.0

type UpdateEnvironmentRevisionTagRequest struct {
	Revision *int `json:"revision,omitempty"`
}

type UpdateEnvironmentScheduleRequest added in v0.24.0

type UpdateEnvironmentScheduleRequest struct {
	ScheduleCron          string                                          `json:"scheduleCron,omitempty"`
	ScheduleOnce          string                                          `json:"scheduleOnce,omitempty"`
	SecretRotationRequest *CreateEnvironmentSecretRotationScheduleRequest `json:"secretRotationRequest,omitempty"`
}

UpdateEnvironmentScheduleRequest is the PATCH body for an existing scheduled action. Only the fields set on the request are modified.

type UpdateEnvironmentTagRequest added in v0.10.0

type UpdateEnvironmentTagRequest struct {
	CurrentTag TagRequest `json:"currentTag"`
	NewTag     TagRequest `json:"newTag"`
}

type UpdateEnvironmentWebhookRequest added in v0.24.0

type UpdateEnvironmentWebhookRequest struct {
	Active      bool     `json:"active"`
	DisplayName string   `json:"displayName"`
	PayloadURL  string   `json:"payloadUrl"`
	Filters     []string `json:"filters,omitempty"`
	Groups      []string `json:"groups,omitempty"`
	Format      *string  `json:"format,omitempty"`
	Secret      string   `json:"secret,omitempty"`
}

UpdateEnvironmentWebhookRequest is the PATCH body for updating an environment webhook. The service's PATCH handler unconditionally replaces DisplayName, PayloadURL, Active, Filters, and Groups from the body, so callers must send the full desired state. Format and Secret are the only fields with "leave unchanged" semantics (nil pointer / empty string respectively), and Secret accepts the sentinel "__remove-secret" to clear a stored secret.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL