client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

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 struct {
	// contains filtered or unexported fields
}

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

func NewClient

func NewClient(apiURL, apiToken string, insecure bool) *Client

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

func (*Client) CheckYAMLEnvironment

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

func (*Client) CreateEnvironment

func (pc *Client) CreateEnvironment(ctx context.Context, orgName, envName string) error

func (*Client) DeleteEnvironment

func (pc *Client) DeleteEnvironment(ctx context.Context, orgName, envName string) error

func (*Client) GetEnvironment

func (pc *Client) GetEnvironment(ctx context.Context, orgName, envName string) ([]byte, string, error)

func (*Client) GetOpenEnvironment

func (pc *Client) GetOpenEnvironment(ctx context.Context, openEnvID string) (*esc.Environment, error)

func (*Client) GetOpenProperty

func (pc *Client) GetOpenProperty(ctx context.Context, openEnvID, property string) (*esc.Value, error)

func (*Client) GetPulumiAccountDetails

func (pc *Client) GetPulumiAccountDetails(ctx context.Context) (string, []string, *workspace.TokenInformation, error)

GetPulumiAccountName returns the user implied by the API token associated with this client.

func (*Client) Insecure

func (pc *Client) Insecure() bool

Returns true if this client is insecure (i.e. has TLS disabled).

func (*Client) ListEnvironments

func (pc *Client) ListEnvironments(ctx context.Context, orgName string) ([]string, error)

func (*Client) OpenEnvironment

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

func (*Client) OpenYAMLEnvironment

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

func (*Client) URL

func (pc *Client) URL() string

URL returns the URL of the API endpoint this client interacts with

func (*Client) UpdateEnvironment

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

type EnvironmentDiagnostic

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

type EnvironmentDiagnosticsResponse

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

func (EnvironmentDiagnosticsResponse) Error

Error implements the Error interface.

type ListEnvironmentsResponse

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

type OpenEnvironmentResponse

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

type UpdateEnvironmentResponse

type UpdateEnvironmentResponse struct {
	EnvironmentDiagnosticsResponse
}

Jump to

Keyboard shortcuts

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