deployment

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Initial    State = "initial"
	Started          = "started"
	Successful       = "successful"
	Failed           = "failed"
)
View Source
const (
	Test       EnvironmentType = "Test"
	Staging                    = "Staging"
	Production                 = "Production"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncDeploymentResult

type AsyncDeploymentResult struct {
	client.ResultMetadata
	Result string `json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*AsyncDeploymentResult) RetrieveStatus

func (ar *AsyncDeploymentResult) RetrieveStatus(ctx context.Context) (*RequestStatusResult, error)

type BBCRelease

type BBCRelease struct {
	Type       ReleaseType `json:"type"`
	Repository Repository  `json:"repository"`
	Commit     Commit      `json:"commit"`
}

func (*BBCRelease) MarshalJSON

func (b *BBCRelease) MarshalJSON() ([]byte, error)

func (*BBCRelease) Validate

func (r *BBCRelease) Validate() error

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *client.Config) (*Client, error)

func (*Client) Create

func (*Client) Get

func (*Client) GetRequestStatus

func (c *Client) GetRequestStatus(ctx context.Context, req *GetRequestStatusRequest) (*RequestStatusResult, error)

func (*Client) UpdateState

type Commit

type Commit struct {
	Sha string `json:"sha"`
}

func (*Commit) Validate

func (r *Commit) Validate() error

type CreateDeploymentRequest

type CreateDeploymentRequest struct {
	client.BaseRequest
	State        State        `json:"state"`
	Environment  *Environment `json:"environment"`
	StartedAt    time.Time    `json:"startedAt"`
	CompletedAt  time.Time    `json:"completedAt, omitempty"`
	Message      string       `json:"message, omitempty"`
	ExternalId   string       `json:"externalId,omitempty"`
	Description  string       `json:"description,omitempty"`
	ExternalLink string       `json:"externalLink,omitempty"`
	Releases     []Release    `json:"releases"`
}

func (*CreateDeploymentRequest) Method

func (r *CreateDeploymentRequest) Method() string

func (*CreateDeploymentRequest) ResourcePath

func (r *CreateDeploymentRequest) ResourcePath() string

func (*CreateDeploymentRequest) Validate

func (r *CreateDeploymentRequest) Validate() error

type Deployment

type Deployment struct {
	Id          string      `json:"id,omitempty"`
	ExternalId  string      `json:"externalId,omitempty"`
	State       string      `json:"state,omitempty"`
	Environment Environment `json:"environment,omitempty"`
	Type        string      `json:"type,omitempty"`
	StartedAt   time.Time   `json:"startedAt,omitempty"`
	CompletedAt time.Time   `json:"completedAt,omitempty"`
	Releases    []Release   `json:"releases,omitempty"`
}

type DeploymentIdentifier

type DeploymentIdentifier uint32
const (
	DEPLOYMENT_ID DeploymentIdentifier = iota
	API
	PIPELINES
)

type Environment

type Environment struct {
	Type        EnvironmentType `json:"type"`
	Id          string          `json:"id"`
	DisplayName string          `json:"displayName, omitempty"`
}

type EnvironmentType

type EnvironmentType string

type GetDeploymentRequest

type GetDeploymentRequest struct {
	client.BaseRequest
	IdentifierType  DeploymentIdentifier
	IdentifierValue string
}

func (*GetDeploymentRequest) Method

func (r *GetDeploymentRequest) Method() string

func (*GetDeploymentRequest) RequestParams

func (r *GetDeploymentRequest) RequestParams() map[string]string

While getting deployment you can use the deployment id as well as externalId that you provided while creating or pipelines UUID

func (*GetDeploymentRequest) ResourcePath

func (r *GetDeploymentRequest) ResourcePath() string

func (*GetDeploymentRequest) Validate

func (r *GetDeploymentRequest) Validate() error

type GetDeploymentResult

type GetDeploymentResult struct {
	client.ResultMetadata
	Deployment `json:"data"`
}

type GetRequestStatusRequest

type GetRequestStatusRequest struct {
	client.BaseRequest
	RequestId string `json:"requestId,omitempty"`
}

func (*GetRequestStatusRequest) Method

func (r *GetRequestStatusRequest) Method() string

func (*GetRequestStatusRequest) ResourcePath

func (r *GetRequestStatusRequest) ResourcePath() string

func (*GetRequestStatusRequest) Validate

func (r *GetRequestStatusRequest) Validate() error

type Release

type Release interface {
	json.Marshaler
	Validate() error
}

type ReleaseType

type ReleaseType string
const (
	BitbucketCloud ReleaseType = "bbc"
)

type Repository

type Repository struct {
	Workspace Workspace `json:"workspace"`
	RepoSlug  string    `json:"repoSlug"`
}

func (*Repository) Validate

func (r *Repository) Validate() error

type RequestStatusResult

type RequestStatusResult struct {
	client.ResultMetadata
	Action       string    `json:"action,omitempty"`
	ProcessedAt  time.Time `json:"processedAt,omitempty"`
	IsSuccess    bool      `json:"isSuccess,omitempty"`
	Status       string    `json:"status,omitempty"`
	DeploymentId string    `json:"deploymentId,omitempty"`
}

type State

type State string

type UpdateDeploymentStateRequest

type UpdateDeploymentStateRequest struct {
	client.BaseRequest
	IdentifierType  DeploymentIdentifier
	IdentifierValue string
	State           State     `json:"state"`
	CompletedAt     time.Time `json:"completedAt"`
}

func (*UpdateDeploymentStateRequest) Method

func (*UpdateDeploymentStateRequest) RequestParams

func (r *UpdateDeploymentStateRequest) RequestParams() map[string]string

While updating state you can use the deployment id as well as externalId that you provided while creating or pipelines UUID

func (*UpdateDeploymentStateRequest) ResourcePath

func (r *UpdateDeploymentStateRequest) ResourcePath() string

func (*UpdateDeploymentStateRequest) Validate

func (r *UpdateDeploymentStateRequest) Validate() error

type Workspace

type Workspace struct {
	Identifier string `json:"identifier"`
	// bbcUuid and name are the only valid values
	// default set as name
	Type string `json:"type"`
}

func (*Workspace) Validate

func (w *Workspace) Validate() error

Jump to

Keyboard shortcuts

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