Documentation
¶
Index ¶
- Constants
- Variables
- func FPrintClusterGet(w io.Writer, lst []*compute.Instance)
- func FPrintComputeList(w io.Writer, lst []*compute.Instance)
- type Client
- func (c *Client) ComputeInstanceCreate(ctx context.Context, cfg *ComputeInstanceConfig) (*operation.Operation, error)
- func (c *Client) ComputeInstanceDelete(ctx context.Context, id string) (*operation.Operation, error)
- func (c *Client) ComputeInstanceGroupCreate(ctx context.Context, id string) (*operation.Operation, error)
- func (c *Client) ComputeInstanceGroupDelete(ctx context.Context, id string) (*operation.Operation, error)
- func (c *Client) ComputeInstanceList(ctx context.Context, folderID string, lbl map[string]string, filters ...Filter) ([]*compute.Instance, error)
- func (c *Client) ComputeInstanceStart(ctx context.Context, id string) (*operation.Operation, error)
- func (c *Client) ComputeInstanceStop(ctx context.Context, id string) (*operation.Operation, error)
- func (c *Client) FirstSubnetInZone(ctx context.Context, folderID string, zone string) (string, error)
- func (c *Client) IAMServiceAccountGetIdByName(ctx context.Context, name string) (string, error)
- type ComputeInstanceConfig
- type ComputeInstanceIPv4
- type Filter
- type FilterOperator
Constants ¶
View Source
const ( KsToolKey = "yc.ks-tool.dev" DefaultDiskType = "network-ssd" DefaultDiskID = "fd83j4siasgfq4pi1qif" //debian-12-v20240920 DefaultDiskSizeGib int64 = 10 DefaultPlatformID = "standard-v3" DefaultZone = "ru-central1-d" DefaultCores int64 = 2 DefaultCoreFraction int64 = 100 DefaultMemoryGib int64 = 2 )
Variables ¶
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewFromIAMKey ¶
NewFromIAMKey creates an SDK instance with credentials for the given IAM Key See https://yandex.cloud/ru/docs/iam/concepts/authorization/iam-token for details.
func NewFromToken ¶
NewFromToken creates an SDK instance with credentials for user Yandex Passport OAuth token. See https://cloud.yandex.ru/docs/iam/concepts/authorization/oauth-token for details.
func (*Client) ComputeInstanceCreate ¶
func (*Client) ComputeInstanceDelete ¶
func (*Client) ComputeInstanceGroupCreate ¶
func (*Client) ComputeInstanceGroupDelete ¶
func (*Client) ComputeInstanceList ¶
func (*Client) ComputeInstanceStart ¶
func (*Client) ComputeInstanceStop ¶
func (*Client) FirstSubnetInZone ¶
type ComputeInstanceConfig ¶
type ComputeInstanceConfig struct {
Name string `mapstructure:"name"`
PlatformID string `mapstructure:"platform-id"`
FolderID string `mapstructure:"folder-id"`
SubnetID string `mapstructure:"subnet-id"`
Zone string `mapstructure:"zone"`
Address string `mapstructure:"address"`
Cores uint `mapstructure:"cores"`
CoreFraction uint `mapstructure:"core-fraction"`
Memory uint `mapstructure:"memory"`
DiskType string `mapstructure:"disk-type"`
DiskID string `mapstructure:"disk-id"`
DiskSize uint `mapstructure:"disk-size"`
Preemptible bool `mapstructure:"preemptible"`
NoPublicIP bool `mapstructure:"no-public-ip"`
ServiceAccount string `mapstructure:"sa"`
UserDataFile string `mapstructure:"user-data-file"`
User string `mapstructure:"user"`
SshPublicKeyFiles []string `mapstructure:"ssh-pub"`
Shell string `mapstructure:"shell"`
ClusterID string
Metadata map[string]string
Labels map[string]string
SshAuthorizedKeys []string
}
func (*ComputeInstanceConfig) SetUserData ¶
func (cfg *ComputeInstanceConfig) SetUserData(tpl string) error
type ComputeInstanceIPv4 ¶
type ComputeInstanceIPv4 struct {
// contains filtered or unexported fields
}
func GetIPv4 ¶
func GetIPv4(i *compute.Instance) ComputeInstanceIPv4
func (ComputeInstanceIPv4) External ¶
func (i ComputeInstanceIPv4) External() string
func (ComputeInstanceIPv4) Internal ¶
func (i ComputeInstanceIPv4) Internal() string
type Filter ¶
type Filter struct {
Field string
Operator FilterOperator
Value any
}
type FilterOperator ¶
type FilterOperator string
const ( OperatorEq FilterOperator = "=" OperatorNe FilterOperator = "!=" OperatorIn FilterOperator = "IN" OperatorNotIn FilterOperator = "NOT IN" )
Click to show internal directories.
Click to hide internal directories.