client

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateDeleted = "deleted"
	StateDefunct = "defunct"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Acl added in v1.6.0

type Acl struct {
	OrganizationID string         `json:"organizationId"`
	ProjectID      string         `json:"projectId"`
	CidrBlocks     []AclCidrBlock `json:"cidrBlocks"`
	Created        string         `json:"created"`
	Name           string         `json:"description"`
	Status         string         `json:"status"`
	Updated        string         `json:"updated"`
}

type AclCidrBlock added in v1.6.0

type AclCidrBlock struct {
	Address string `json:"address"`
	Comment string `json:"comment"`
}

type AclUpdateRequest added in v1.6.0

type AclUpdateRequest struct {
	OrganizationID string
	ProjectID      string
	AclID          string
	CidrBlocks     []AclCidrBlock `json:"cidrBlocks,omitempty"`
	Description    string         `json:"description,omitempty"`
}

type Client

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

func New

func New(opts *Config) (*Client, error)

func (*Client) AclCreate added in v1.6.0

func (*Client) AclDelete added in v1.6.0

func (c *Client) AclDelete(ctx context.Context, req *DeleteAclRequest) diag.Diagnostics

func (*Client) AclGet added in v1.6.0

func (*Client) AclUpdate added in v1.6.0

func (c *Client) AclUpdate(ctx context.Context, req *AclUpdateRequest) diag.Diagnostics

func (*Client) CreateIntegration added in v1.5.4

func (c *Client) CreateIntegration(
	ctx context.Context,
	organizationId string,
	projectId string,
	createIntegrationRequest CreateIntegrationRequest,
) (*CreateIntegrationResponse, diag.Diagnostics)

func (*Client) CreateJob added in v1.5.3

func (c *Client) CreateJob(
	ctx context.Context,
	organizationId string,
	projectId string,
	createJobRequest CreateJobRequest,
) (*CreateJobResponse, diag.Diagnostics)

func (*Client) DeleteIntegration added in v1.5.4

func (c *Client) DeleteIntegration(
	ctx context.Context,
	organizationId string,
	projectId string,
	integrationId string,
) diag.Diagnostics

func (*Client) DeleteJob added in v1.5.3

func (c *Client) DeleteJob(
	ctx context.Context,
	organizationId string,
	projectId string,
	jobId string,
) diag.Diagnostics

func (*Client) GetIntegration added in v1.5.4

func (c *Client) GetIntegration(
	ctx context.Context,
	organizationId string,
	projectId string,
	integrationId string,
) (*GetIntegrationResponse, diag.Diagnostics)

func (*Client) GetJob added in v1.5.3

func (c *Client) GetJob(
	ctx context.Context,
	organizationId string,
	projectId string,
	jobId string,
) (*GetJobResponse, diag.Diagnostics)

func (*Client) ListIntegrations added in v1.5.4

func (c *Client) ListIntegrations(
	ctx context.Context,
	organizationId string,
	projectId string,
) (*ListIntegrationsResponse, diag.Diagnostics)

func (*Client) ManagedClusterDelete

func (c *Client) ManagedClusterDelete(
	ctx context.Context,
	req *DeleteManagedClusterRequest,
) diag.Diagnostics

func (*Client) ManagedClusterExpandDisk added in v1.2.0

func (c *Client) ManagedClusterExpandDisk(
	ctx context.Context,
	req *ExpandManagedClusterDiskRequest,
) diag.Diagnostics

func (*Client) ManagedClusterGet

func (*Client) ManagedClusterResize added in v1.5.29

func (c *Client) ManagedClusterResize(
	ctx context.Context,
	req *ManagedClusterResizeRequest,
) diag.Diagnostics

func (*Client) ManagedClusterUpdate added in v1.5.8

func (c *Client) ManagedClusterUpdate(
	ctx context.Context,
	req *ManagedClusterUpdateRequest,
) diag.Diagnostics

func (*Client) ManagedClusterUpgrade added in v1.5.27

func (c *Client) ManagedClusterUpgrade(
	ctx context.Context,
	req *ManagedClusterUpgradeRequest,
) diag.Diagnostics

func (*Client) ManagedClusterWaitForState

func (c *Client) ManagedClusterWaitForState(
	ctx context.Context,
	req *WaitForManagedClusterStateRequest,
) diag.Diagnostics

func (*Client) NetworkCreate

func (*Client) NetworkDelete

func (c *Client) NetworkDelete(ctx context.Context, req *DeleteNetworkRequest) diag.Diagnostics

func (*Client) NetworkGet

func (c *Client) NetworkGet(
	ctx context.Context,
	req *GetNetworkRequest,
) (*GetNetworkResponse, diag.Diagnostics)

func (*Client) NetworkList added in v1.5.8

func (*Client) NetworkUpdate

func (c *Client) NetworkUpdate(ctx context.Context, req *UpdateNetworkRequest) diag.Diagnostics

func (*Client) NetworkWaitForState

func (c *Client) NetworkWaitForState(
	ctx context.Context,
	req *WaitForNetworkStateRequest,
) diag.Diagnostics

func (*Client) PeeringCreate

func (*Client) PeeringDelete

func (c *Client) PeeringDelete(ctx context.Context, req *DeletePeeringRequest) diag.Diagnostics

func (*Client) PeeringGet

func (c *Client) PeeringGet(
	ctx context.Context,
	req *GetPeeringRequest,
) (*GetPeeringResponse, diag.Diagnostics)

func (*Client) PeeringUpdate

func (c *Client) PeeringUpdate(ctx context.Context, req *UpdatePeeringRequest) diag.Diagnostics

func (*Client) PeeringWaitForState

func (c *Client) PeeringWaitForState(
	ctx context.Context,
	req *WaitForPeeringStateRequest,
) (*Peering, diag.Diagnostics)

func (*Client) ProjectCreate

func (*Client) ProjectDelete

func (c *Client) ProjectDelete(ctx context.Context, req *DeleteProjectRequest) diag.Diagnostics

func (*Client) ProjectGet

func (c *Client) ProjectGet(
	ctx context.Context,
	req *GetProjectRequest,
) (*GetProjectResponse, diag.Diagnostics)

func (*Client) ProjectList

func (*Client) ProjectUpdate

func (c *Client) ProjectUpdate(ctx context.Context, req *UpdateProjectRequest) diag.Diagnostics

func (*Client) TokenInspect

func (c *Client) TokenInspect(audience string) (*tokenData, error)

Inspect a token from the local token store

func (*Client) TokenRefresh

func (c *Client) TokenRefresh(force bool) error

Convenience function

func (*Client) UpdateIntegration added in v1.5.4

func (c *Client) UpdateIntegration(
	ctx context.Context,
	organizationId string,
	projectId string,
	integrationId string,
	updateIntegrationRequest UpdateIntegrationRequest,
) diag.Diagnostics

type Config

type Config struct {
	URL                 string
	IdentityProviderURL string
	ClientID            string
	TokenStore          string
	RefreshToken        string
}

type CreateAclRequest added in v1.6.0

type CreateAclRequest struct {
	OrganizationID string
	ProjectID      string
	Name           string         `json:"description"`
	CidrBlocks     []AclCidrBlock `json:"cidrBlocks"`
}

type CreateAclResponse added in v1.6.0

type CreateAclResponse struct {
	AclID string `json:"id"`
}

type CreateIntegrationData added in v1.5.4

type CreateIntegrationData struct {
	CreateOpsGenieIntegrationData *CreateOpsGenieIntegrationData
	CreateSlackIntegrationData    *CreateSlackIntegrationData
}

type CreateIntegrationRequest added in v1.5.4

type CreateIntegrationRequest struct {
	Data        map[string]interface{} `json:"data"`
	Description string                 `json:"description"`
}

type CreateIntegrationResponse added in v1.5.4

type CreateIntegrationResponse struct {
	Id string `json:"id"`
}

type CreateJobRequest added in v1.5.3

type CreateJobRequest struct {
	Data        map[string]interface{} `json:"data"`
	Description string                 `json:"description"`
	Schedule    string                 `json:"schedule"`
	Type        string                 `json:"type"`
}

type CreateJobResponse added in v1.5.3

type CreateJobResponse struct {
	Id string `json:"id"`
}

type CreateManagedClusterRequest

type CreateManagedClusterRequest struct {
	OrganizationID  string
	ProjectID       string
	NetworkId       string `json:"networkId"`
	Name            string `json:"description"`
	Topology        string `json:"topology"`
	InstanceType    string `json:"instanceType"`
	DiskSizeGB      int32  `json:"diskSizeGb"`
	DiskType        string `json:"diskType"`
	DiskIops        int32  `json:"diskIops"`
	DiskThroughput  int32  `json:"diskThroughput"`
	ServerVersion   string `json:"serverVersion"`
	ProjectionLevel string `json:"projectionLevel"`
	CloudAuth       bool   `json:"cloudIntegratedAuthentication"`
	Protected       bool   `json:"protected"`
	PublicAccess    bool   `json:"publicAccess"`
	AclId           string `json:"aclId"`
}

type CreateManagedClusterResponse

type CreateManagedClusterResponse struct {
	ClusterID string `json:"id"`
}

type CreateNetworkRequest

type CreateNetworkRequest struct {
	OrganizationID   string
	ProjectID        string
	ResourceProvider string `json:"provider"`
	CidrBlock        string `json:"cidrBlock,omitempty"`
	Name             string `json:"description"`
	PublicAccess     bool   `json:"publicAccess,omitempty"`
	Region           string `json:"region"`
}

type CreateNetworkResponse

type CreateNetworkResponse struct {
	NetworkID string `json:"id"`
}

type CreateOpsGenieIntegrationData added in v1.5.4

type CreateOpsGenieIntegrationData struct {
	// API key used with the Ops Genie integration API
	ApiKey string `json:"apiKey"`
	// Required. Must be set to \"opsGenie\"
	Sink   string  `json:"sink"`
	Source *string `json:"source,omitempty"`
}

type CreatePeeringRequest

type CreatePeeringRequest struct {
	OrganizationID        string
	ProjectID             string
	NetworkId             string   `json:"networkId"`
	Name                  string   `json:"description"`
	PeerAccountIdentifier string   `json:"peerAccountId"`
	PeerNetworkIdentifier string   `json:"peerNetworkId"`
	PeerNetworkRegion     string   `json:"peerNetworkRegion"`
	Routes                []string `json:"routes"`
}

type CreatePeeringResponse

type CreatePeeringResponse struct {
	PeeringID string `json:"id"`
}

type CreateProjectRequest

type CreateProjectRequest struct {
	OrganizationID string
	Name           string `json:"name"`
}

type CreateProjectResponse

type CreateProjectResponse struct {
	ProjectID string `json:"id"`
}

type CreateSlackIntegrationData added in v1.5.4

type CreateSlackIntegrationData struct {
	// Slack Channel to send messages to
	ChannelId string `json:"channelId"`
	// API token for the Slack bot
	Token string `json:"token"`
	// Required. Must be set to \"slack\"
	Sink   string  `json:"sink"`
	Source *string `json:"source,omitempty"`
}

type DeleteAclRequest added in v1.6.0

type DeleteAclRequest struct {
	OrganizationID string
	ProjectID      string
	AclID          string
}

type DeleteManagedClusterRequest

type DeleteManagedClusterRequest struct {
	OrganizationID string
	ProjectID      string
	ClusterID      string
}

type DeleteNetworkRequest

type DeleteNetworkRequest struct {
	OrganizationID string
	ProjectID      string
	NetworkID      string
}

type DeletePeeringRequest

type DeletePeeringRequest struct {
	OrganizationID string
	ProjectID      string
	PeeringID      string
}

type DeleteProjectRequest

type DeleteProjectRequest struct {
	OrganizationID string
	ProjectID      string
}

type ExpandManagedClusterDiskRequest added in v1.2.0

type ExpandManagedClusterDiskRequest struct {
	OrganizationID string
	ProjectID      string
	ClusterID      string `json:"clusterId"`
	DiskIops       int32  `json:"diskIops,omitempty"`
	DiskSizeGB     int32  `json:"diskSizeGb"`
	DiskThroughput int32  `json:"diskThroughput,omitempty"`
	DiskType       string `json:"diskType"`
}

type GetAclRequest added in v1.6.0

type GetAclRequest struct {
	OrganizationID string
	ProjectID      string
	AclID          string
}

type GetAclResponse added in v1.6.0

type GetAclResponse struct {
	Acl Acl `json:"acl"`
}

type GetIntegrationResponse added in v1.5.4

type GetIntegrationResponse struct {
	Integration Integration `json:"integration"`
}

type GetJobResponse added in v1.5.3

type GetJobResponse struct {
	Job Job `json:"job"`
}

type GetManagedClusterRequest

type GetManagedClusterRequest struct {
	OrganizationID string
	ProjectID      string
	ClusterID      string
}

type GetManagedClusterResponse

type GetManagedClusterResponse struct {
	ManagedCluster ManagedCluster `json:"cluster"`
}

type GetNetworkRequest

type GetNetworkRequest struct {
	OrganizationID string
	ProjectID      string
	NetworkID      string
}

type GetNetworkResponse

type GetNetworkResponse struct {
	Network Network `json:"network"`
}

type GetPeeringRequest

type GetPeeringRequest struct {
	OrganizationID string
	ProjectID      string
	PeeringID      string
}

type GetPeeringResponse

type GetPeeringResponse struct {
	Peering Peering `json:"peering"`
}

type GetProjectRequest

type GetProjectRequest struct {
	OrganizationID string
	ProjectID      string
}

type GetProjectResponse

type GetProjectResponse struct {
	Project Project `json:"project"`
}

type Integration added in v1.5.4

type Integration struct {
	Created        time.Time              `json:"created"`
	Data           map[string]interface{} `json:"data"`
	Description    string                 `json:"description"`
	Id             string                 `json:"id"`
	OrganizationId string                 `json:"organizationId"`
	ProjectId      string                 `json:"projectId"`
	Status         IntegrationStatus      `json:"status"`
	Updated        time.Time              `json:"updated"`
}

type IntegrationData added in v1.5.4

type IntegrationData struct {
	OpsGenieIntegrationData *OpsGenieIntegrationData
	SlackIntegrationData    *SlackIntegrationData
}

type IntegrationStatus added in v1.5.4

type IntegrationStatus string
const (
	ACTIVE  IntegrationStatus = "active"
	DELETED IntegrationStatus = "deleted"
)

List of IntegrationStatus

type Job added in v1.5.3

type Job struct {
	Data           map[string]interface{} `json:"data"`
	Description    string                 `json:"description"`
	Id             string                 `json:"id"`
	OrganizationId string                 `json:"organizationId"`
	ProjectId      string                 `json:"projectId"`
	Schedule       string                 `json:"schedule"`
	Status         string                 `json:"status"`
	Type           string                 `json:"type"`
}

type ListIntegrationsResponse added in v1.5.4

type ListIntegrationsResponse struct {
	Integrations []Integration `json:"integrations"`
}

type ListNetworksRequest added in v1.5.8

type ListNetworksRequest struct {
	OrganizationID string
	ProjectID      string
}

type ListNetworksResponse added in v1.5.8

type ListNetworksResponse struct {
	Networks []Network `json:"networks"`
}

type ListProjectsRequest

type ListProjectsRequest struct {
	OrganizationID string
}

type ListProjectsResponse

type ListProjectsResponse struct {
	Projects []Project `json:"projects"`
}

type ManagedCluster

type ManagedCluster struct {
	OrganizationID   string `json:"organizationId"`
	ProjectID        string `json:"projectId"`
	NetworkID        string `json:"networkId"`
	ClusterID        string `json:"id"`
	Name             string `json:"description"`
	Provider         string `json:"provider"`
	Region           string `json:"region"`
	Topology         string `json:"topology"`
	InstanceType     string `json:"instanceType"`
	DiskSizeGB       int32  `json:"diskSizeGb"`
	DiskType         string `json:"diskType"`
	DiskIops         int32  `json:"diskIops"`
	DiskThroughput   int32  `json:"diskThroughput"`
	ServerVersion    string `json:"serverVersion"`
	ServerVersionTag string `json:"serverVersionTag"`
	ProjectionLevel  string `json:"projectionLevel"`
	Status           string `json:"status"`
	Created          string `json:"created"`
	Protected        bool   `json:"protected"`
	AclId            string `json:"aclId"`
	PublicAccess     bool   `json:"publicAccess"`
}

type ManagedClusterResizeRequest added in v1.5.29

type ManagedClusterResizeRequest struct {
	OrganizationID string
	ProjectID      string
	ClusterID      string
	TargetSize     string `json:"targetSize"`
}

type ManagedClusterUpdateRequest added in v1.5.8

type ManagedClusterUpdateRequest struct {
	OrganizationID string
	ProjectID      string
	ClusterID      string
	Description    string `json:"description"`
	Protected      bool   `json:"protected"`
}

type ManagedClusterUpgradeRequest added in v1.5.27

type ManagedClusterUpgradeRequest struct {
	OrganizationID string
	ProjectID      string
	ClusterID      string
	TargetTag      string `json:"targetTag"`
}

type Network

type Network struct {
	NetworkID    string `json:"id"`
	ProjectID    string `json:"projectId"`
	Provider     string `json:"provider"`
	Region       string `json:"region"`
	CIDRBlock    string `json:"cidrBlock,omitempty"`
	Name         string `json:"description"`
	Status       string `json:"status"`
	PublicAccess bool   `json:"publicAccess"`
}

type OpsGenieIntegrationData added in v1.5.4

type OpsGenieIntegrationData struct {
	// API key used with the Ops Genie integration API
	ApiKeyDisplay string `json:"apiKeyDisplay"`
	// Required. Must be set to \"opsGenie\"
	Sink string `json:"sink"`
	// Source of data for integration
	Source string `json:"source"`
}

type Peering

type Peering struct {
	ProjectID               string            `json:"projectId"`
	PeeringID               string            `json:"id"`
	NetworkID               string            `json:"networkId"`
	Provider                string            `json:"provider"`
	Name                    string            `json:"description"`
	PeerAccountIdentifier   string            `json:"peerAccountId"`
	PeerNetworkIdentifier   string            `json:"peerNetworkId"`
	PeerNetworkRegion       string            `json:"peerNetworkRegion"`
	ProviderPeeringMetadata map[string]string `json:"providerPeeringMetadata"`
	Routes                  []string          `json:"routes"`
	Status                  string            `json:"status"`
	Created                 string            `json:"created,omitempty"`
}

type Project

type Project struct {
	ProjectID      string `json:"id"`
	OrganizationID string `json:"organizationId"`
	Name           string `json:"name"`
	Created        string `json:"created"`
}

type SlackIntegrationData added in v1.5.4

type SlackIntegrationData struct {
	// Slack Channel to send messages to
	ChannelId string `json:"channelId"`
	// API token for the Slack bot
	TokenDisplay string `json:"tokenDisplay"`
	// Required. Must be set to \"slack\"
	Sink string `json:"sink"`
	// Source of data for integration
	Source string `json:"source"`
}

type UpdateIntegrationRequest added in v1.5.4

type UpdateIntegrationRequest struct {
	Data        *map[string]interface{} `json:"data,omitempty"`
	Description *string                 `json:"description,omitempty"`
}

type UpdateNetworkRequest

type UpdateNetworkRequest struct {
	OrganizationID string
	ProjectID      string
	NetworkID      string
	Name           string `json:"description"`
}

type UpdateOpsGenieIntegrationData added in v1.5.4

type UpdateOpsGenieIntegrationData struct {
	// API key used with the Ops Genie integration API
	ApiKey *string `json:"apiKey,omitempty"`
}

type UpdatePeeringRequest

type UpdatePeeringRequest struct {
	OrganizationID string
	ProjectID      string
	PeeringID      string
	Name           string `json:"description"`
}

type UpdateProjectRequest

type UpdateProjectRequest struct {
	OrganizationID string
	ProjectID      string
	Name           string `json:"name"`
}

type UpdateSlackIntegrationData added in v1.5.4

type UpdateSlackIntegrationData struct {
	// Slack Channel to send messages to
	ChannelId *string `json:"channelId,omitempty"`
	// API token for the Slack bot
	Token *string `json:"token,omitempty"`
}

type WaitForManagedClusterStateRequest

type WaitForManagedClusterStateRequest struct {
	OrganizationID string
	ProjectID      string
	ClusterID      string
	State          string
}

type WaitForNetworkStateRequest

type WaitForNetworkStateRequest struct {
	OrganizationID string
	ProjectID      string
	NetworkID      string
	State          string
}

type WaitForPeeringStateRequest

type WaitForPeeringStateRequest struct {
	OrganizationID string
	ProjectID      string
	PeeringID      string
	State          string
}

Jump to

Keyboard shortcuts

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