Documentation ¶
Index ¶
- Constants
- type BatchDeleteInstanceArgs
- type Capabilities
- type Client
- func (c *Client) BatchDeleteInstance(args *BatchDeleteInstanceArgs) error
- func (c *Client) CreateInstance(args *CreateInstanceArgs) (*CreateInstanceResult, error)
- func (c *Client) DeleteInstance(args *DeleteInstanceArgs) error
- func (c *Client) GetInstance(args *GetInstanceArgs) (*GetInstanceResult, error)
- func (c *Client) ListInstances(args *ListInstanceArgs) (*ListInstanceResult, error)
- type ConfigFileDetail
- type ConfigFileVolume
- type Container
- type ContainerDetailModel
- type ContainerSecurityContext
- type ContainerStatus
- type CreateInstanceArgs
- type CreateInstanceResult
- type DeleteInstanceArgs
- type EmptyDirVolume
- type Environment
- type ExecAction
- type GRPCAction
- type GetInstanceArgs
- type GetInstanceResult
- type HTTPGetAction
- type HTTPHeader
- type ImageRegistryCredential
- type InstanceDetailModel
- type InstanceModel
- type ListInstanceArgs
- type ListInstanceResult
- type NfsVolume
- type Port
- type Probe
- type SecurityGroupModel
- type SubnetModel
- type TCPSocketAction
- type Tag
- type Volume
- type VolumeMount
- type VpcModel
Constants ¶
View Source
const ( URI_PREFIX_v2 = bce.URI_PREFIX + "v2" DEFAULT_PREFIX = URI_PREFIX_v2 DEFAULT_BCI_ENDPOINT = "bci." + bce.DEFAULT_REGION + ".baidubce.com" REQUEST_BCI_URL = "/instance" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchDeleteInstanceArgs ¶
type Capabilities ¶
type Client ¶
Client of BCI service is a kind of BceClient, so derived from BceClient
func (*Client) BatchDeleteInstance ¶
func (c *Client) BatchDeleteInstance(args *BatchDeleteInstanceArgs) error
BatchDeleteInstance - batch delete bcis
PARAMS:
- args: the arguments to batch delete bcis
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) CreateInstance ¶
func (c *Client) CreateInstance(args *CreateInstanceArgs) (*CreateInstanceResult, error)
CreateInstance - create a bci with the specific parameters
PARAMS:
- args: the arguments to create a bci
RETURNS:
- *CreateInstanceResult: the result of create bci
- error: nil if success otherwise the specific error
func (*Client) DeleteInstance ¶
func (c *Client) DeleteInstance(args *DeleteInstanceArgs) error
DeleteInstance - delete a bci
PARAMS:
- args: the arguments to delete a bci
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) GetInstance ¶
func (c *Client) GetInstance(args *GetInstanceArgs) (*GetInstanceResult, error)
GetInstance - query bci detail with the specific parameters
PARAMS:
- args: the arguments to list all bci
RETURNS:
- *GetInstanceResult: the result of query bci detail
- error: nil if success otherwise the specific error
func (*Client) ListInstances ¶
func (c *Client) ListInstances(args *ListInstanceArgs) (*ListInstanceResult, error)
ListInstance - list all bcis with the specific parameters
PARAMS:
- args: the arguments to list all bcis
RETURNS:
- *ListInstanceResult: the result of list all bcis
- error: nil if success otherwise the specific error
type ConfigFileDetail ¶
type ConfigFileVolume ¶
type ConfigFileVolume struct { Name string `json:"name,omitempty"` DefaultMode int `json:"defaultMode,omitempty"` ConfigFiles []ConfigFileDetail `json:"configFiles,omitempty"` }
type Container ¶
type Container struct { Name string `json:"name"` Image string `json:"image"` Memory float64 `json:"memory,omitempty"` CPU float64 `json:"cpu,omitempty"` GPU float64 `json:"gpu,omitempty"` WorkingDir string `json:"workingDir"` ImagePullPolicy string `json:"imagePullPolicy,omitempty"` Commands []string `json:"commands,omitempty"` Args []string `json:"args,omitempty"` VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` Ports []Port `json:"ports,omitempty"` EnvironmentVars []Environment `json:"environmentVars,omitempty"` LivenessProbe *Probe `json:"livenessProbe,omitempty"` ReadinessProbe *Probe `json:"readinessProbe,omitempty"` StartupProbe *Probe `json:"startupProbe,omitempty"` Stdin bool `json:"stdin,omitempty"` StdinOnce bool `json:"stdinOnce,omitempty"` Tty bool `json:"tty,omitempty"` SecurityContext *ContainerSecurityContext `json:"securityContext,omitempty"` }
type ContainerDetailModel ¶
type ContainerDetailModel struct { Name string `json:"name,omitempty"` Image string `json:"image,omitempty"` CPU float64 `json:"cpu,omitempty"` GPU float64 `json:"gpu,omitempty"` Memory float64 `json:"memory,omitempty"` WorkingDir string `json:"workingDir"` ImagePullPolicy string `json:"imagePullPolicy,omitempty"` Commands []string `json:"commands,omitempty"` Args []string `json:"args,omitempty"` Ports []Port `json:"ports,omitempty"` VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` Envs []Environment `json:"envs,omitempty"` CreateTime string `json:"createTime,omitempty"` UpdateTime string `json:"updateTime,omitempty"` DeleteTime string `json:"deleteTime,omitempty"` PreviousState *ContainerStatus `json:"previousState,omitempty"` CurrentState *ContainerStatus `json:"currentState,omitempty"` Ready bool `json:"ready,omitempty"` RestartCount int `json:"restartCount,omitempty"` }
type ContainerSecurityContext ¶
type ContainerSecurityContext struct { Capabilities *Capabilities `json:"capabilities,omitempty"` RunAsUser int64 `json:"runAsUser,omitempty"` RunAsGroup int64 `json:"runAsGroup,omitempty"` RunAsNonRoot bool `json:"runAsNonRoot,omitempty"` ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem,omitempty"` }
type ContainerStatus ¶
type ContainerStatus struct { State string `json:"state,omitempty"` Reason string `json:"reason,omitempty"` Message string `json:"message,omitempty"` StartTime string `json:"startTime,omitempty"` FinishTime string `json:"finishTime,omitempty"` DetailStatus string `json:"detailStatus,omitempty"` ExitCode int `json:"exitCode,omitempty"` }
type CreateInstanceArgs ¶
type CreateInstanceArgs struct { ClientToken string `json:"-"` Name string `json:"name"` ZoneName string `json:"zoneName,omitempty"` SecurityGroupIds []string `json:"securityGroupIds,omitempty"` SubnetIds []string `json:"subnetIds,omitempty"` RestartPolicy string `json:"restartPolicy,omitempty"` EipIp string `json:"eipIp,omitempty"` AutoCreateEip bool `json:"autoCreateEip,omitempty"` EipName string `json:"eipName,omitempty"` EipRouteType string `json:"eipRouteType,omitempty"` EipBandwidthInMbps int `json:"eipBandwidthInMbps,omitempty"` EipBillingMethod string `json:"eipBillingMethod,omitempty"` GPUType string `json:"gpuType,omitempty"` TerminationGracePeriodSeconds int64 `json:"terminationGracePeriodSeconds,omitempty"` HostName string `json:"hostName,omitempty"` Tags []Tag `json:"tags,omitempty"` ImageRegistryCredentials []ImageRegistryCredential `json:"imageRegistryCredentials,omitempty"` Containers []Container `json:"containers,omitempty"` InitContainers []Container `json:"initContainers,omitempty"` Volume *Volume `json:"volume,omitempty"` }
type CreateInstanceResult ¶
type CreateInstanceResult struct {
InstanceId string `json:"instanceId,omitempty"`
}
type DeleteInstanceArgs ¶
type EmptyDirVolume ¶
type Environment ¶
type ExecAction ¶
type ExecAction struct {
Command []string `json:"command,omitempty"`
}
type GRPCAction ¶
type GetInstanceArgs ¶
type GetInstanceArgs struct {
InstanceId string `json:"instanceId"`
}
type GetInstanceResult ¶
type GetInstanceResult struct {
Instance *InstanceDetailModel `json:"instance,omitempty"`
}
type HTTPGetAction ¶
type HTTPGetAction struct { Path string `json:"path,omitempty"` Port int `json:"port,omitempty"` Scheme string `json:"scheme,omitempty"` Host string `json:"host,omitempty"` HTTPHeaders *HTTPHeader `json:"httpHeaders,omitempty"` }
type HTTPHeader ¶
type ImageRegistryCredential ¶
type InstanceDetailModel ¶
type InstanceDetailModel struct { InstanceModel Volume *Volume `json:"volume,omitempty"` Containers []ContainerDetailModel `json:"containers,omitempty"` InitContainers []ContainerDetailModel `json:"initContainers,omitempty"` SecurityGroups []SecurityGroupModel `json:"securityGroups,omitempty"` Vpc *VpcModel `json:"vpc,omitempty"` Subnet *SubnetModel `json:"subnet,omitempty"` }
type InstanceModel ¶
type InstanceModel struct { InstanceId string `json:"instanceId,omitempty"` InstanceName string `json:"instanceName,omitempty"` Status string `json:"status,omitempty"` ZoneName string `json:"zoneName,omitempty"` CPUType string `json:"cpuType,omitempty"` GPUType string `json:"gpuType,omitempty"` BandwidthInMbps int `json:"bandwidthInMbps,omitempty"` InternalIp string `json:"internalIp,omitempty"` PublicIp string `json:"publicIp,omitempty"` CreateTime string `json:"createTime,omitempty"` UpdateTime string `json:"updateTime,omitempty"` DeleteTime string `json:"deleteTime,omitempty"` RestartPolicy string `json:"restartPolicy,omitempty"` Tags []Tag `json:"tags,omitempty"` }
type ListInstanceArgs ¶
type ListInstanceResult ¶
type ListInstanceResult struct { Marker string `json:"marker,omitempty"` IsTruncated bool `json:"isTruncated,omitempty"` NextMarker string `json:"nextMarker,omitempty"` MaxKeys int `json:"maxKeys,omitempty"` Result []InstanceModel `json:"result,omitempty"` }
type Probe ¶
type Probe struct { InitialDelaySeconds int `json:"initialDelaySeconds,omitempty"` TimeoutSeconds int `json:"timeoutSeconds,omitempty"` PeriodSeconds int `json:"periodSeconds,omitempty"` SuccessThreshold int `json:"successThreshold,omitempty"` FailureThreshold int `json:"failureThreshold,omitempty"` TerminationGracePeriodSeconds int64 `json:"terminationGracePeriodSeconds,omitempty"` HTTPGet *HTTPGetAction `json:"httpGet,omitempty"` TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty"` Exec *ExecAction `json:"exec,omitempty"` GRPC *GRPCAction `json:"grpc,omitempty"` }
type SecurityGroupModel ¶
type SubnetModel ¶
type SubnetModel struct { SubnetId string `json:"subnetId,omitempty"` Name string `json:"name,omitempty"` Cidr string `json:"cidr,omitempty"` VpcId string `json:"vpcId,omitempty"` SubnetType string `json:"subnetType,omitempty"` Description string `json:"description,omitempty"` CreateTime string `json:"createTime,omitempty"` }
type TCPSocketAction ¶
type Volume ¶
type Volume struct { Nfs []NfsVolume `json:"nfs,omitempty"` EmptyDir []EmptyDirVolume `json:"emptyDir,omitempty"` ConfigFile []ConfigFileVolume `json:"configFile,omitempty"` }
type VolumeMount ¶
Click to show internal directories.
Click to hide internal directories.