client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 18 Imported by: 2

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckEnvironmentResponse

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

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)

	ListEnvironments(
		ctx context.Context,
		orgName string,
		continuationToken string,
	) ([]OrgEnvironment, string, error)

	CreateEnvironment(ctx context.Context, orgName, envName string) error

	GetEnvironment(ctx context.Context, orgName, envName string) ([]byte, string, error)

	UpdateEnvironment(
		ctx context.Context,
		orgName string,
		envName string,
		yaml []byte,
		tag string,
	) ([]EnvironmentDiagnostic, error)

	DeleteEnvironment(ctx context.Context, orgName, envName string) error

	OpenEnvironment(
		ctx context.Context,
		orgName string,
		envName string,
		duration time.Duration,
	) (string, []EnvironmentDiagnostic, error)

	CheckYAMLEnvironment(
		ctx context.Context,
		orgName string,
		yaml []byte,
	) (*esc.Environment, []EnvironmentDiagnostic, error)

	OpenYAMLEnvironment(
		ctx context.Context,
		orgName string,
		yaml []byte,
		duration time.Duration,
	) (string, []EnvironmentDiagnostic, error)

	GetOpenEnvironment(ctx context.Context, orgName, envName, openEnvID string) (*esc.Environment, error)

	GetOpenProperty(ctx context.Context, orgName, envName, openEnvID, property string) (*esc.Value, error)
}

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

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.

type EnvironmentDiagnostic

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

type EnvironmentDiagnosticError

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

func (EnvironmentDiagnosticError) Error

func (err EnvironmentDiagnosticError) Error() string

Error implements the Error interface.

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 ListEnvironmentsResponse

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

type OpenEnvironmentResponse

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

type OrgEnvironment

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

type UpdateEnvironmentResponse

type UpdateEnvironmentResponse struct {
	EnvironmentDiagnosticError
}

Jump to

Keyboard shortcuts

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