Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Host information. HostName string `json:"hostName" required:"true"` // Access address information. Endpoints []string `json:"endpoints" required:"true"` // Microservice version. Version string `json:"version,omitempty"` // Instance status. Value: UP, DOWN, STARTING, or OUTOFSERVICE. Default value: UP. Status string `json:"status,omitempty"` // Extended attribute. You can customize a key and value. The value must be at least 1 byte long. Properties map[string]interface{} `json:"properties,omitempty"` // Health check information. HealthCheck *HealthCheck `json:"healthCheck,omitempty"` // Data center information. DataCenterInfo *DataCenter `json:"dataCenterInfo,omitempty"` }
CreateOpts is the structure required by the Create method to create a new dedicated microservice instance.
type CreateResp ¶
type CreateResp struct { // Microservice instance ID. ID string `json:"instanceId"` }
CreateResp is the structure that represents the response of the API request.
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOpts, serviceId, token string) (*CreateResp, error)
Create is a method to create a dedicated microservice instance using given parameters.
type DataCenter ¶
type DataCenter struct { // Region name. Name string `json:"name" required:"true"` // Region. Region string `json:"region" required:"true"` // AZ. AvailableZone string `json:"availableZone" required:"true"` }
DataCenter is an object that specifies the configuration of the instance data center.
type ErrorResponse ¶
type ErrorResponse struct { // Error detail. Detail string `json:"detail"` // Error code. ErrCode string `json:"errorCode"` // Error message. ErrMessage string `json:"errorMessage"` }
ErrorResponse is the structure that represents the details of the request error.
type HealthCheck ¶
type HealthCheck struct { // Heartbeat mode. Value: push or pull. Mode string `json:"mode" required:"true"` // Heartbeat interval. Unit: s. If the value is less than 5s, the registration is performed at an interval of 5s. Interval int `json:"interval" required:"true"` // Maximum retries. Times int `json:"times" required:"true"` // Port. Port int `json:"port,omitempty"` }
HealthCheck is an object that specifies the configuration of the instance health check.
type Instance ¶
type Instance struct { // Host information. HostName string `json:"hostName"` // Access address information. Endpoints []string `json:"endpoints"` // Instance ID, which must be unique. The instance ID is generated by the service center. ID string `json:"instanceId"` // Microservice ID, which must be unique. // During instance creation, use the service ID in the URL instead of the service ID here. ServiceId string `json:"serviceId"` // Microservice version. Version string `json:"version"` // Instance status. Value: UP, DOWN, STARTING, or OUTOFSERVICE. Default value: UP. Status string `json:"status"` // Extended attribute. You can customize a key and value. The value must be at least 1 byte long. Properties map[string]interface{} `json:"properties"` // Health check information. HealthCheck HealthCheck `json:"healthCheck"` // Data center information. DataCenterInfo DataCenter `json:"dataCenterInfo"` // Time when an instance is created, which is automatically generated. Timestamp string `json:"timestamp"` // Update time. ModTimestamp string `json:"modTimestamp"` }
Instance is the structure that represents the details of the Microservice service instance.
Click to show internal directories.
Click to hide internal directories.