Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(c *golangsdk.ServiceClient, opts DeleteOpts, engineId, token string) error
Delete is a method to remove an existing microservice using its unique ID (and token).
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Microservice information. Services Service `json:"service" required:"true"` // Blacklist and whitelist. Rules []Rule `json:"rules,omitempty"` // Instance information. Instances []instances.CreateOpts `json:"instances,omitempty"` // Extended attribute. You can customize a key and value. The value must be at least 1 byte long. Tags map[string]interface{} `json:"tags,omitempty"` }
CreateOpts is the structure required by the Create method to create a new dedicated microservice.
type CreateResp ¶
type CreateResp struct { // Microservice ID. ID string `json:"serviceId"` }
CreateResp is the structure that represents the response of the API request.
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOpts, token string) (*CreateResp, error)
Create is a method to create a microservice using given parameters.
type DeleteOpts ¶
type DeleteOpts struct {
Force bool `q:"force"`
}
DeleteOpts is the structure required by the Delete method to specified whether microservice is force delete.
type Framework ¶
type Framework struct { // Microservice development framework. Default value: UNKNOWN. Name string `json:"name,omitempty"` // Version of the microservice development framework. Version string `json:"version,omitempty"` }
Framework is an object that specifies the configuration of the microservice framework.
type Rule ¶
type Rule struct { // Customized rule ID. RuleId string `json:"ruleId,omitempty"` // Rule type. Value: WHITE or BLACK. RuleType string `json:"ruleType,omitempty"` // If the value starts with tag_xxx, the attributes are filtered by Tag. // Otherwise, the attributes are filtered by serviceId, AppId, ServiceName, Version, Description, Level, or Status. Attribute string `json:"attribute,omitempty"` // Matching rule. The value is a regular expression containing 1 to 64 characters. Pattern string `json:"pattern,omitempty"` // Rule description. Description string `json:"description,omitempty"` // Time when a rule is created. This parameter is used only when you query rules. Timestamp string `json:"timestamp,omitempty"` // Update time. ModTimestamp string `json:"modTimestamp,omitempty"` }
Rule is an object that specifies the configuration of the black list or white list.
type Service ¶
type Service struct { // Microservice name, which must be unique in an application. The value contains 1 to 128 characters. // Regular expression: ^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$ Name string `json:"serviceName" required:"true"` // Application ID, which must be unique. The value contains 1 to 160 characters. // Regular expression: ^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$ AppId string `json:"appId" required:"true"` // Microservice version. The value contains 1 to 64 characters. Regular expression: ^[0-9]$|^[0-9]+(.[0-9]+)$ Version string `json:"version" required:"true"` // Microservice ID, which must be unique. The value contains 1 to 64 characters. Regular expression: ^.*$ ID string `json:"serviceId,omitempty"` // Service stage. Value: development, testing, acceptance, or production. // Only when the value is development, testing, or acceptance, you can use the API for uploading schemas in batches // to add or modify an existing schema. Default value: development. Environment *string `json:"environment,omitempty"` // Microservice description. The value contains a maximum of 256 characters. Description string `json:"description,omitempty"` // Microservice level. Value: FRONT, MIDDLE, or BACK. Level string `json:"level,omitempty"` // Microservice registration mode. Value: SDK, PLATFORM, SIDECAR, or UNKNOWN. RegisterBy string `json:"registerBy,omitempty"` // Foreign key ID of a microservice access schema. The array length supports a maximum of 100 schemas. Schemas []string `json:"schemas,omitempty"` // Microservice status. Value: UP or DOWN. Default value: UP. Status string `json:"status,omitempty"` // Microservice registration time. Timestamp string `json:"timestamp,omitempty"` // Latest modification time (UTC). ModTimestamp string `json:"modTimestamp,omitempty"` // Development framework. Framework *Framework `json:"framework,omitempty"` // Service path. Paths []ServicePath `json:"paths,omitempty"` }
Service is an object that specifies the microservice configuration details.
type ServicePath ¶
type ServicePath struct { // Route address. Path string `json:"Path,omitempty"` // Extended attribute. You can customize a key and value. The value must be at least 1 byte long. Property map[string]interface{} `json:"Property,omitempty"` }
ServicePath is an object that specifies the configuration of the service path.
type ServiceResp ¶
type ServiceResp struct { // Microservice name, which must be unique in an application. The value contains 1 to 128 characters. // Regular expression: ^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$ Name string `json:"serviceName" required:"true"` // Application ID, which must be unique. The value contains 1 to 160 characters. // Regular expression: ^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$ AppId string `json:"appId" required:"true"` // Microservice version. The value contains 1 to 64 characters. Regular expression: ^[0-9]$|^[0-9]+(.[0-9]+)$ Version string `json:"version" required:"true"` // Microservice ID, which must be unique. The value contains 1 to 64 characters. Regular expression: ^.*$ ID string `json:"serviceId,omitempty"` // Service stage. Value: development, testing, acceptance, or production. // Only when the value is development, testing, or acceptance, you can use the API for uploading schemas in batches // to add or modify an existing schema. Default value: development. Environment string `json:"environment,omitempty"` // Microservice description. The value contains a maximum of 256 characters. Description string `json:"description,omitempty"` // Microservice level. Value: FRONT, MIDDLE, or BACK. Level string `json:"level,omitempty"` // Microservice registration mode. Value: SDK, PLATFORM, SIDECAR, or UNKNOWN. RegisterBy string `json:"registerBy,omitempty"` // Foreign key ID of a microservice access schema. The array length supports a maximum of 100 schemas. Schemas []string `json:"schemas,omitempty"` // Microservice status. Value: UP or DOWN. Default value: UP. Status string `json:"status,omitempty"` // Microservice registration time. Timestamp string `json:"timestamp,omitempty"` // Latest modification time (UTC). ModTimestamp string `json:"modTimestamp,omitempty"` // Development framework. Framework Framework `json:"framework,omitempty"` // Service path. Paths []ServicePath `json:"paths,omitempty"` }
ServiceResp is an object that specifies the microservice configuration details.
func Get ¶
func Get(c *golangsdk.ServiceClient, serviceId, token string) (*ServiceResp, error)
Get is a method to retrieves a particular configuration based on its unique ID (and token).