Documentation
¶
Index ¶
- func CreateInferenceDeployment(c *gcorecloud.ServiceClient, opts CreateInferenceDeploymentOptsBuilder) (r tasks.Result)
- func DeleteInferenceDeployment(c *gcorecloud.ServiceClient, name string) (r tasks.Result)
- func UpdateInferenceDeployment(c *gcorecloud.ServiceClient, name string, ...) (r tasks.Result)
- type Container
- type ContainerDeployStatus
- type ContainerScale
- type ContainerScaleTrigger
- type CreateContainerOpts
- type CreateInferenceDeploymentOpts
- type CreateInferenceDeploymentOptsBuilder
- type CreateLoggingOpts
- type ExecProbe
- type GetResult
- type HttpGetProbe
- type InferenceDeployment
- type ListResult
- type Logging
- type LoggingRetentionPolicy
- type Probe
- type ProbeConfiguration
- type Probes
- type ScaleTriggerHttp
- type ScaleTriggerSqs
- type ScaleTriggerThreshold
- type TcpSocketProbe
- type UpdateInferenceDeploymentOpts
- type UpdateInferenceDeploymentOptsBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateInferenceDeployment ¶
func CreateInferenceDeployment(c *gcorecloud.ServiceClient, opts CreateInferenceDeploymentOptsBuilder) (r tasks.Result)
CreateInferenceDeployment create FaaS function.
func DeleteInferenceDeployment ¶
func DeleteInferenceDeployment(c *gcorecloud.ServiceClient, name string) (r tasks.Result)
DeleteInferenceDeployment accepts a unique ID and deletes the inference deployment associated with it.
func UpdateInferenceDeployment ¶
func UpdateInferenceDeployment(c *gcorecloud.ServiceClient, name string, opts UpdateInferenceDeploymentOptsBuilder) (r tasks.Result)
UpdateInferenceDeployment update existing inference deployment.
Types ¶
type Container ¶
type Container struct { RegionID int `json:"region_id"` Address string `json:"address"` Scale ContainerScale `json:"scale"` DeployStatus ContainerDeployStatus `json:"deploy_status"` ErrorMessage string `json:"error_message"` }
type ContainerDeployStatus ¶
type ContainerScale ¶
type ContainerScale struct { Min int `json:"min"` Max int `json:"max"` CooldownPeriod *int `json:"cooldown_period"` PollingInterval *int `json:"polling_interval"` Triggers ContainerScaleTrigger `json:"triggers"` }
type ContainerScaleTrigger ¶
type ContainerScaleTrigger struct { Cpu *ScaleTriggerThreshold `json:"cpu,omitempty"` GpuMemory *ScaleTriggerThreshold `json:"gpu_memory,omitempty"` GpuUtilization *ScaleTriggerThreshold `json:"gpu_utilization,omitempty"` Memory *ScaleTriggerThreshold `json:"memory,omitempty"` Http *ScaleTriggerHttp `json:"http,omitempty"` Sqs *ScaleTriggerSqs `json:"sqs,omitempty"` }
type CreateContainerOpts ¶
type CreateContainerOpts struct { RegionID int `json:"region_id"` Scale ContainerScale `json:"scale"` }
CreateContainerOpts represents options used to create a container.
type CreateInferenceDeploymentOpts ¶
type CreateInferenceDeploymentOpts struct { Name string `json:"name"` Image string `json:"image"` ListeningPort int `json:"listening_port"` Description string `json:"description"` AuthEnabled bool `json:"auth_enabled"` Containers []CreateContainerOpts `json:"containers"` Timeout *int `json:"timeout,omitempty"` Envs map[string]string `json:"envs,omitempty"` Command []string `json:"command,omitempty"` CredentialsName *string `json:"credentials_name,omitempty"` Logging *CreateLoggingOpts `json:"logging,omitempty"` Probes *Probes `json:"probes,omitempty"` FlavorName string `json:"flavor_name"` }
CreateInferenceDeploymentOpts represents options used to create a function.
func (CreateInferenceDeploymentOpts) ToRegistryCredentialCreateMap ¶
func (opts CreateInferenceDeploymentOpts) ToRegistryCredentialCreateMap() (map[string]interface{}, error)
ToInferenceInstanceCreateMap builds a request body from CreateInferenceDeploymentOpts.
type CreateInferenceDeploymentOptsBuilder ¶
type CreateInferenceDeploymentOptsBuilder interface {
ToRegistryCredentialCreateMap() (map[string]interface{}, error)
}
CreateInferenceDeploymentOptsBuilder allows extensions to add additional parameters to the request.
type CreateLoggingOpts ¶
type CreateLoggingOpts struct { Enabled bool `json:"enabled"` DestinationRegionID int `json:"destination_region_id"` TopicName string `json:"topic_name"` RetentionPolicy LoggingRetentionPolicy `json:"retention_policy"` }
CreateLoggingOpts represents options used to create a logging.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a InferenceDeployment.
func GetInferenceDeployment ¶
func GetInferenceDeployment(c *gcorecloud.ServiceClient, name string) (r GetResult)
GetInferenceDeployment get inference deployment instance.
func (GetResult) Extract ¶
func (r GetResult) Extract() (*InferenceDeployment, error)
Extract is a function that accepts a result and extracts a inference resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type HttpGetProbe ¶
type InferenceDeployment ¶
type InferenceDeployment struct { ProjectID int `json:"project_id"` Name string `json:"name"` Description string `json:"description"` Image string `json:"image"` ListeningPort int `json:"listening_port"` CreatedAt *string `json:"created_at"` AuthEnabled bool `json:"auth_enabled"` Address string `json:"address"` Timeout int `json:"timeout"` Envs map[string]string `json:"envs"` FlavorName string `json:"flavor_name"` Command *string `json:"command"` CredentialsName string `json:"credentials_name"` Logging *Logging `json:"logging"` Probes *Probes `json:"probes"` Containers []Container `json:"containers"` Status string `json:"status"` }
func ListAllInferenceDeployments ¶
func ListAllInferenceDeployments(c *gcorecloud.ServiceClient) ([]InferenceDeployment, error)
ListAllInferenceDeployments lists all inference deployments.
type ListResult ¶
type ListResult struct {
gcorecloud.Result
}
func (ListResult) Extract ¶
func (r ListResult) Extract() ([]InferenceDeployment, error)
Extract is a function that accepts a result and extracts a inference deployment resource.
func (ListResult) ExtractInto ¶
func (r ListResult) ExtractInto(v interface{}) error
type LoggingRetentionPolicy ¶
type LoggingRetentionPolicy struct {
Period *int `json:"period"`
}
type Probe ¶
type Probe struct { FailureThreshold int `json:"failure_threshold"` InitialDelaySeconds int `json:"initial_delay_seconds"` PeriodSeconds int `json:"period_seconds"` TimeoutSeconds int `json:"timeout_seconds"` SuccessThreshold int `json:"success_threshold"` Exec *ExecProbe `json:"exec"` TcpSocket *TcpSocketProbe `json:"tcp_socket"` HttpGet *HttpGetProbe `json:"http_get"` }
type ProbeConfiguration ¶
type Probes ¶
type Probes struct { LivenessProbe *ProbeConfiguration `json:"liveness_probe"` ReadinessProbe *ProbeConfiguration `json:"readiness_probe"` StartupProbe *ProbeConfiguration `json:"startup_probe"` }
type ScaleTriggerHttp ¶
type ScaleTriggerSqs ¶ added in v0.10.1
type ScaleTriggerSqs struct { QueueURL string `json:"queue_url"` QueueLength int `json:"queue_length"` ActivationQueueLength int `json:"activation_queue_length"` ScaleOnFlight bool `json:"scale_on_flight"` ScaleOnDelayed bool `json:"scale_on_delayed"` AwsRegion string `json:"aws_region"` AwsEndpoint *string `json:"aws_endpoint"` SecretName string `json:"secret_name"` }
type ScaleTriggerThreshold ¶
type ScaleTriggerThreshold struct {
Threshold int `json:"threshold"`
}
type TcpSocketProbe ¶
type TcpSocketProbe struct {
Port int `json:"port"`
}
type UpdateInferenceDeploymentOpts ¶
type UpdateInferenceDeploymentOpts struct { Description *string `json:"description,omitempty"` Image *string `json:"image,omitempty"` ListeningPort *int `json:"listening_port,omitempty"` AuthEnabled *bool `json:"auth_enabled,omitempty"` Containers []CreateContainerOpts `json:"containers,omitempty"` Timeout *int `json:"timeout"` Envs map[string]string `json:"envs,omitempty"` Command []string `json:"command"` Logging *CreateLoggingOpts `json:"logging,omitempty"` Probes *Probes `json:"probes,omitempty"` FlavorName *string `json:"flavor_name"` CredentialsName *string `json:"credentials_name"` }
UpdateInferenceDeploymentOpts represents options used to update a function.
func (UpdateInferenceDeploymentOpts) ToRegistryCredentialUpdateMap ¶
func (opts UpdateInferenceDeploymentOpts) ToRegistryCredentialUpdateMap() (map[string]interface{}, error)
ToInferenceDeploymentUpdateMap builds a request body from UpdateInferenceDeploymentOpts.
type UpdateInferenceDeploymentOptsBuilder ¶
type UpdateInferenceDeploymentOptsBuilder interface {
ToRegistryCredentialUpdateMap() (map[string]interface{}, error)
}
UpdateInferenceDeploymentOptsBuilder allows extensions to add additional parameters to the request.