Documentation ¶
Index ¶
- func List(client *golangsdk.ServiceClient, instanceId string, opts ListOptsBuilder) pagination.Pager
- func ListPublishHistories(client *golangsdk.ServiceClient, instanceId, apiId string, ...) pagination.Pager
- type APIConditionBase
- type APIOpts
- type APIOptsBuilder
- type APIPage
- type APIResp
- type ApiVersionInfo
- type AuthOpt
- type BackendParamBase
- type BackendParamResp
- type CreateResult
- type DeleteResult
- type FuncGraph
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type ListPublishHistoriesBuilder
- type ListPublishHistoriesOpts
- type Mock
- type PolicyFuncGraph
- type PolicyFuncGraphResp
- type PolicyMock
- type PolicyMockResp
- type PolicyWeb
- type PolicyWebResp
- type PublishHistoriesPage
- type PublishOpts
- type PublishOptsBuilder
- type PublishResp
- type PublishResult
- type ReqParamBase
- type ReqParamResp
- type UpdateResult
- type VersionSwitchOpts
- type VersionSwitchOptsBuilder
- type VpcChannel
- type Web
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *golangsdk.ServiceClient, instanceId string, opts ListOptsBuilder) pagination.Pager
List is a method to obtain an array of one or more APIs according to the query parameters.
func ListPublishHistories ¶
func ListPublishHistories(client *golangsdk.ServiceClient, instanceId, apiId string, opts ListPublishHistoriesBuilder) pagination.Pager
ListPublishHistories is a method to obtains a list of publish histories of the API.
Types ¶
type APIConditionBase ¶
type APIConditionBase struct { // The ID of the condition. ID string `json:"id,omitempty"` // Policy type. The valid types are as following: // param: input parameter // source: source IP address // system: gateway built-in parameter // cookie: cookie parameter // frontend_authorizer: frontend authentication parameter ConditionOrigin string `json:"condition_origin" required:"true"` // Condition value. ConditionValue string `json:"condition_value" required:"true"` // Input parameter name. This parameter is required if the policy type is param. ReqParamName string `json:"req_param_name,omitempty"` // Gateway built-in parameter name. This parameter is required if the policy type is system. SysParamName string `json:"sys_param_name,omitempty"` // Cookie parameter name. This parameter is required if the policy type is cookie. CookieParamName string `json:"cookie_param_name,omitempty"` // Frontend authentication parameter name. This parameter is required if the policy type is frontend_authorizer. FrontendAuthorizerParamName string `json:"frontend_authorizer_param_name,omitempty"` // Policy condition. The valid values are as following: // exact: exact match // enum: enumeration // pattern: regular expression // This parameter is required if the policy type is param, system, cookie and frontend_authorizer. ConditionType string `json:"condition_type,omitempty"` // The ID of the corresponding request parameter. ReqParamId string `json:"req_param_id,omitempty"` // The location of the corresponding request parameter. ReqParamLocation string `json:"req_param_location,omitempty"` // Name of a parameter generated after orchestration. // This parameter is mandatory when condition_origin is set to orchestration. // The generated parameter name must exist in the orchestration rule bound to the API. MappedParamName string `json:"mapped_param_name,omitempty"` // Location of a parameter generated after orchestration. // This parameter is mandatory when condition_origin is set to orchestration. // This location must exist in the orchestration rule bound to the API. MappedParamLocation string `json:"mapped_param_location,omitempty"` }
APIConditionBase is an object which will be build up a policy condition.
type APIOpts ¶
type APIOpts struct { // ID of the API group to which the API belongs. GroupId string `json:"group_id" required:"true"` // API name, which can contain 3 to 64 characters, starting with a letter. // Only letters, digits, and underscores (_) are allowed. // Chinese characters must be in UTF-8 or Unicode format. Name string `json:"name" required:"true"` // API type. The valid types are as following: // 1: public API // 2: private API Type int `json:"type" required:"true"` // Request protocol. The valid protocols are as following: // HTTP. // HTTPS (default). // BOTH: The API can be accessed through both HTTP and HTTPS. ReqProtocol string `json:"req_protocol" required:"true"` // Request method. The valid values are GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS and ANY. ReqMethod string `json:"req_method" required:"true"` // Request address, which can contain a maximum of 512 characters request parameters enclosed with brackets ({}). // For example, /getUserInfo/{userId}. // The request address can contain special characters, such as asterisks (), percent signs (%), hyphens (-), and // underscores (_) and must comply with URI specifications. // The address can contain environment variables, each starting with a letter and consisting of 3 to 32 characters. // Only letters, digits, hyphens (-), and underscores (_) are allowed in environment variables. ReqURI string `json:"req_uri" required:"true"` // Security authentication mode. The valid modes are as following: // NONE // APP // IAM // AUTHORIZER AuthType string `json:"auth_type" required:"true"` // Backend type. The valid types are as following: // HTTP: web backend. // FUNCTION: FunctionGraph backend. // MOCK: Mock backend. BackendType string `json:"backend_type" required:"true"` // API version. The maximum length of version string is 16. Version *string `json:"version,omitempty"` // Security authentication parameter. AuthOpt *AuthOpt `json:"auth_opt,omitempty"` // Indicates whether CORS is supported. The valid values are as following: // TRUE: supported. // FALSE: not supported (default). Cors *bool `json:"cors,omitempty"` // Route matching mode. The valid modes are as following: // SWA: prefix match // NORMAL: exact match (default). MatchMode string `json:"match_mode,omitempty"` // Description of the API, which can contain a maximum of 255 characters. // Chinese characters must be in UTF-8 or Unicode format. Description *string `json:"remark,omitempty"` // API request body, which can be an example request body, media type, or parameters. // Ensure that the request body does not exceed 20,480 characters. // Chinese characters must be in UTF-8 or Unicode format. BodyDescription *string `json:"body_remark,omitempty"` // Example response for a successful request. Ensure that the response does not exceed 20,480 characters. // Chinese characters must be in UTF-8 or Unicode format. ResultNormalSample *string `json:"result_normal_sample,omitempty"` // Example response for a failed request. Ensure that the response does not exceed 20,480 characters. // Chinese characters must be in UTF-8 or Unicode format. ResultFailureSample *string `json:"result_failure_sample,omitempty"` // ID of the frontend custom authorizer. AuthorizerId string `json:"authorizer_id,omitempty"` // List of tags. The length of the tags list is range from 1 to 128. // The value can contain only letters, digits, and underscores (_), and must start with a letter. Tags []string `json:"tags,omitempty"` // Group response ID. ResponseId string `json:"response_id,omitempty"` // Request parameters. ReqParams []ReqParamBase `json:"req_params,omitempty"` // Backend parameters. BackendParams []BackendParamBase `json:"backend_params,omitempty"` // Mock backend details. MockInfo *Mock `json:"mock_info,omitempty"` // FunctionGraph backend details. FuncInfo *FuncGraph `json:"func_info,omitempty"` // Web backend details. WebInfo *Web `json:"backend_api,omitempty"` // Mock policy backends. PolicyMocks []PolicyMock `json:"policy_mocks,omitempty"` // FunctionGraph policy backends. PolicyFunctions []PolicyFuncGraph `json:"policy_functions,omitempty"` // Web policy backends. PolicyWebs []PolicyWeb `json:"policy_https,omitempty"` }
APIOpts is a struct which will be used to create a new API or update an existing API.
func (APIOpts) ToAPIOptsMap ¶
ToAPIOptsMap is a method which to build a request body by the APIOpts.
type APIOptsBuilder ¶
APIOptsBuilder is an interface which to support request body build of the API creation and updation.
type APIPage ¶
type APIPage struct {
pagination.SinglePageBase
}
APIPage represents the api pages of the List operation.
type APIResp ¶
type APIResp struct { // API name which can contains of 3 to 64 characters, starting with a letter. // Only letters, digits, and underscores (_) are allowed. // Chinese characters must be in UTF-8 or Unicode format. Name string `json:"name"` // API type. The valid types are as following: // 1: public API // 2: private API Type int `json:"type"` // API version which can contains maximum of 16 characters. Version string `json:"version"` // Request protocol. // HTTP // HTTPS (default) // BOTH: The API can be accessed through both HTTP and HTTPS. ReqProtocol string `json:"req_protocol"` // Request method. The valid values are GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS and ANY. ReqMethod string `json:"req_method"` // Request address, which can contain request parameters enclosed with brackets ({}). For example, // /getUserInfo/{userId}. // The request address can contain special characters, such as asterisks (*), percent signs (%), hyphens (-), and underscores (_). It can contain a maximum of 512 characters and must comply with URI specifications. // The request address must comply with URI specifications. ReqURI string `json:"req_uri"` // Security authentication mode. The valid values are as following: // NONE // APP // IAM // AUTHORIZER AuthType string `json:"auth_type"` // Security authentication parameter. AuthOpt AuthOpt `json:"auth_opt"` // Indicates whether CORS is supported. // TRUE: supported // FALSE: not supported (default). Cors bool `json:"cors"` // Route matching mode. // SWA: prefix match // NORMAL: exact match (default). MatchMode string `json:"match_mode"` // Backend type. The valid types are as following: // HTTP: web backend // FUNCTION: FunctionGraph backend // MOCK: Mock backend BackendType string `json:"backend_type"` // Description of the API, which can contain a maximum of 255 characters. // Chinese characters must be in UTF-8 or Unicode format. Description string `json:"remark"` // ID of the API group to which the API belongs. GroupId string `json:"group_id"` // API request body, which can be an example request body, media type, or parameters. // Ensure that the request body does not exceed 20,480 characters. // Chinese characters must be in UTF-8 or Unicode format. BodyDescription string `json:"body_remark"` // Example response for a successful request. Ensure that the response does not exceed 20,480 characters. // Chinese characters must be in UTF-8 or Unicode format. ResultNormalSample string `json:"result_normal_sample"` // Example response for a failed request. Ensure that the response does not exceed 20,480 characters. // Chinese characters must be in UTF-8 or Unicode format. ResultFailureSample string `json:"result_failure_sample"` // ID of the frontend custom authorizer. AuthorizerId string `json:"authorizer_id"` // Tags. Tags []string `json:"tags"` // Group response ID. ResponseId string `json:"response_id"` // API ID. ID string `json:"id"` // API status. 1: valid Status int `json:"status"` // Indicates whether to enable orchestration. ArrangeNecessary int `json:"arrange_necessary"` // Time when the API is registered. RegisterTime string `json:"register_time"` // Time when the API was last modified. UpdateTime string `json:"update_time"` // Name of the API group to which the API belongs. GroupName string `json:"group_name"` // Version of the API group to which the API belongs. // The default value is V1. Other versions are not supported. GroupVersion string `json:"group_version"` // ID of the environment in which the API has been published. // If there are multiple publication records, separate the environment IDs with vertical bars (|). RunEnvId string `json:"run_env_id"` // Name of the environment in which the API has been published. // If there are multiple publication records, separate the environment names with vertical bars (|). RunEnvName string `json:"run_env_name"` // Publication record ID. // You can separate multiple publication record IDs with vertical bars (|). PublishId string `json:"publish_id"` // FunctionGraph backend details. FuncInfo FuncGraph `json:"func_info"` // Mock backend details. MockInfo Mock `json:"mock_info"` // Web backend details. WebInfo Web `json:"backend_api"` // Request parameters. ReqParams []ReqParamResp `json:"req_params"` // Backend parameters. BackendParams []BackendParamResp `json:"backend_params"` // Mock policy backends. PolicyMocks []PolicyMockResp `json:"policy_mocks"` // FunctionGraph policy backends. PolicyFunctions []PolicyFuncGraphResp `json:"policy_functions"` // Web policy backends. PolicyWebs []PolicyWebResp `json:"policy_https"` // The following four parameters are only provided by the response of the API Versions. // SlDomain // SlDomains // VersionId // PublishTime. // Subdomain name that API Gateway automatically allocates to the API group. SlDomain string `json:"sl_domain"` // Subdomain names that API Gateway automatically allocates to the API group. SlDomains []string `json:"sl_domains"` // API version ID. VersionId string `json:"version_id"` //Time when the API version is published. PublishTime string `json:"publish_time"` }
APIResp is a struct that represents the result of Create, Update, Get and List methods.
func ExtractApis ¶
func ExtractApis(r pagination.Page) ([]APIResp, error)
ExtractApis is a method to extract an response struct list.
func GetVersionDetail ¶
func GetVersionDetail(client *golangsdk.ServiceClient, instanceId, versionId string) (*APIResp, error)
GetVersionDetail is a method to obtains a publish detail of the API for special version.
type ApiVersionInfo ¶
type ApiVersionInfo struct { // API version ID. VersionId string `json:"version_id"` // API version. Version string `json:"version_no"` // API ID. ApiId string `json:"api_id"` // ID of the environment in which the API has been published. EnvId string `json:"env_id"` // Name of the environment in which the API has been published. EnvName string `json:"env_name"` // Description about the publication. Description string `json:"remark"` // Publication time. PublishTime string `json:"publish_time"` // Version status. // 1: effective // 2: not effective Status int `json:"status"` }
ApiVersionInfo is a struct that represents the result of ExtractHistories operation.
func ExtractHistories ¶
func ExtractHistories(r pagination.Page) ([]ApiVersionInfo, error)
ExtractHistories is a method which to extract the response to a version information list.
type AuthOpt ¶
type AuthOpt struct { // Indicates whether AppCode authentication is enabled. The valid types are as following: // DISABLE: AppCode authentication is disabled (default). // HEADER: AppCode authentication is enabled and the AppCode is located in the header. // This parameter is valid only if auth_type is set to App. AppCodeAuthType string `json:"app_code_auth_type,omitempty"` }
AuthOpt is an object which will be build up an APIG application authorization.
type BackendParamBase ¶
type BackendParamBase struct { // Parameter type. The valid types are as following: // REQUEST: Backend parameter. // CONSTANT: Constant parameter. // SYSTEM: System parameter. Origin string `json:"origin" required:"true"` // Parameter name, which can contains 1 to 32 characters, must start with a letter and can only contain letters, // digits, hyphens (-), underscores (_) and periods (.). Name string `json:"name" required:"true"` // Parameter location. The valid values are PATH, QUERY and HEADER. Location string `json:"location" required:"true"` // Parameter value, which can contain a maximum of 255 characters. If the origin type is REQUEST, the value of this parameter is the parameter name in req_params. // If the origin type is CONSTANT, the value is a constant. // If the origin type is SYSTEM, the value is a system parameter name. System parameters include gateway parameters, frontend authentication parameters, and backend authentication parameters. You can set the frontend or backend authentication parameters after enabling custom frontend or backend authentication. // The gateway parameters are as follows: // $context.sourceIp: source IP address of the API caller. // $context.stage: deployment environment in which the API is called. // $context.apiId: API ID. // $context.appId: ID of the app used by the API caller. // $context.requestId: request ID generated when the API is called. // $context.serverAddr: address of the gateway server. // $context.serverName: name of the gateway server. // $context.handleTime: time when the API request is processed. // $context.providerAppId: ID of the app used by the API owner. This parameter is currently not supported. // Frontend authentication parameter: prefixed with "$context.authorizer.frontend.". For example, to return "aaa" upon successful custom authentication, set this parameter to "$context.authorizer.frontend.aaa". // Backend authentication parameter: prefixed with "$context.authorizer.backend.". For example, to return "aaa" upon successful custom authentication, set this parameter to "$context.authorizer.backend.aaa". Value string `json:"value" required:"true"` // Description, which can contain a maximum of 255 characters. // Chinese characters must be in UTF-8 or Unicode format. Description *string `json:"remark,omitempty"` }
BackendParamBase is an object which will be build up a back-end parameter.
type BackendParamResp ¶
type BackendParamResp struct { // Parameter type. The valid types are as following: // REQUEST: Backend parameter. // CONSTANT: Constant parameter. // SYSTEM: System parameter. Origin string `json:"origin"` // Parameter name, which can contains 1 to 32 characters, must start with a letter and can only contain letters, digits, hyphens (-), underscores (_), // and periods (.). Name string `json:"name"` // Description, which can contain a maximum of 255 characters. // Chinese characters must be in UTF-8 or Unicode format. Description string `json:"remark"` // Parameter location. The valid values are PATH, QUERY and HEADER. Location string `json:"location"` // Parameter value, which can contain a maximum of 255 characters. // If the origin type is REQUEST, the value of this parameter is the parameter name in req_params. // If the origin type is CONSTANT, the value is a constant. // If the origin type is SYSTEM, the value is a system parameter name. // System parameters include gateway parameters, front-end authentication parameters, and back-end authentication // parameters. You can set the frontend or backend authentication parameters after enabling custom frontend or // backend authentication. // The gateway parameters are as follows: // $context.sourceIp: source IP address of the API caller. // $context.stage: deployment environment in which the API is called. // $context.apiId: API ID. // $context.appId: ID of the app used by the API caller. // $context.requestId: request ID generated when the API is called. // $context.serverAddr: address of the gateway server. // $context.serverName: name of the gateway server. // $context.handleTime: time when the API request is processed. // $context.providerAppId: ID of the app used by the API owner. This parameter is currently not supported. // Frontend authentication parameter: prefixed with "$context.authorizer.frontend.". // For example, to return "aaa" upon successful custom authentication, set this parameter to // "$context.authorizer.frontend.aaa". // Backend authentication parameter: prefixed with "$context.authorizer.backend.". // For example, to return "aaa" upon successful custom authentication, set this parameter to // "$context.authorizer.backend.aaa". Value string `json:"value"` // The ID of the backend parameter. ID string `json:"id"` // ID of the the specifies request parameter. ReqParamId string `json:"req_param_id"` }
BackendParamResp is an object struct that represents the elements of the back-end parameter.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents a result of the Create method.
func Create ¶
func Create(client *golangsdk.ServiceClient, instanceId string, opts APIOptsBuilder) (r CreateResult)
Create is a method by which to create function that create a new custom API.
type DeleteResult ¶
DeleteResult represents a result of the Delete method.
func Delete ¶
func Delete(client *golangsdk.ServiceClient, instanceId, apiId string) (r DeleteResult)
Delete is a method to delete an existing custom API.
type FuncGraph ¶
type FuncGraph struct { // The ID of the backend configration. ID string `json:"id,omitempty"` // Function URN. FunctionUrn string `json:"function_urn" required:"true"` // Invocation mode. The valid modes are as following: // async: asynchronous // sync: synchronous InvocationType string `json:"invocation_type" required:"true"` // Timeout, in ms, which allowed for API Gateway to request the backend service. // The valid value is range from 1 to 600,000. Timeout int `json:"timeout" required:"true"` // The network architecture type of the function. NetworkType string `json:"network_type,omitempty"` // Function alias URN. FunctionAliasUrn string `json:"alias_urn,omitempty"` // Backend custom authorizer ID. AuthorizerId *string `json:"authorizer_id,omitempty"` // Description about the backend, which can contain a maximum of 255 characters. // Chinese characters must be in UTF-8 or Unicode format. Description *string `json:"remark,omitempty"` // Function version. // Maximum: 64 Version string `json:"version,omitempty"` // The request protocol of the function. RequestProtocol string `json:"req_protocol,omitempty"` }
FuncGraph is an object which will be build up a function graph backend.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents a result of the Get method.
type ListOpts ¶
type ListOpts struct { // API ID. ID string `q:"id"` // API name. Name string `q:"name"` // API group ID. GroupId string `q:"group_id"` // Request protocol. ReqProtocol string `q:"req_protocol"` // Request method. ReqMethod string `q:"req_method"` // Request path. ReqURI string `q:"req_uri"` // Security authentication mode. AuthType string `q:"auth_type"` // ID of the environment in which the API has been published. EnvId string `q:"env_id"` // API type. Type int `q:"type"` // Offset from which the query starts. // If the offset is less than 0, the value is automatically converted to 0. Default to 0. Offset int `q:"offset"` // Number of items displayed on each page. The range of number is form 1 to 500, default to 20. Limit int `q:"limit"` // Parameter name (name or req_uri) for exact matching. PreciseSearch string `q:"precise_search"` }
ListOpts allows to filter list data using given parameters.
func (ListOpts) ToListOptsQuery ¶
ToListOptsQuery is a method which to build a request query by the ListOpts.
type ListOptsBuilder ¶
ListOptsBuilder is an interface which to support request query build of the API search.
type ListPublishHistoriesBuilder ¶
ListPublishHistoriesBuilder is an interface which to support request query build of the publish histories search.
type ListPublishHistoriesOpts ¶
type ListPublishHistoriesOpts struct { // Environment ID. EnvId string `q:"env_id"` // Environment name. EnvName string `q:"env_name"` // Offset from which the query starts. If the offset is less than 0, the value is automatically converted to 0. // Default: 0 Offset int `q:"offset"` // Number of items displayed on each page. // Minimum: 1 // Maximum: 500 // Default: 20 Limit int `q:"limit"` }
ListPublishHistoriesOpts allows to obtains a list of publish histories using given parameters.
func (ListPublishHistoriesOpts) ToListPublishHistoriesQuery ¶
func (opts ListPublishHistoriesOpts) ToListPublishHistoriesQuery() (string, error)
ToListPublishHistoriesQuery is a method which to build a request query by the ListPublishHistoriesOpts.
type Mock ¶
type Mock struct { // The ID of the backend configration. ID string `json:"id,omitempty"` // The custom status code of the mock response. StatusCode int `json:"status_code,omitempty"` // Description about the backend, which can contain a maximum of 255 characters. // Chinese characters must be in UTF-8 or Unicode format. Description *string `json:"remark,omitempty"` // Response. ResultContent *string `json:"result_content,omitempty"` // Function version Ensure that the version does not exceed 64 characters. Version string `json:"version,omitempty"` // Backend custom authorizer ID. AuthorizerId *string `json:"authorizer_id,omitempty"` }
Mock is an object which will be build up a mock backend.
type PolicyFuncGraph ¶
type PolicyFuncGraph struct { // Policy conditions. Conditions []APIConditionBase `json:"conditions" required:"true"` // Effective mode of the backend policy. // ALL: All conditions are met. // ANY: Any condition is met. EffectMode string `json:"effect_mode" required:"true"` // Function URN. FunctionUrn string `json:"function_urn" required:"true"` // Invocation mode. The valid modes are as following: // async: asynchronous // sync: synchronous InvocationType string `json:"invocation_type" required:"true"` // The backend name consists of 3 to 64 characters, which must start with a letter and can contain letters, digits, // and underscores (_). Name string `json:"name" required:"true"` // The network architecture type of the function. NetworkType string `json:"network_type,omitempty"` // Function alias URN. FunctionAliasUrn string `json:"alias_urn,omitempty"` // Authorizer ID. AuthorizerId *string `json:"authorizer_id,omitempty"` // Backend parameters. BackendParams []BackendParamBase `json:"backend_params,omitempty"` // Timeout, in ms, which allowed for API Gateway to request the backend service. // The valid value is range from 1 to 600,000. Timeout int `json:"timeout,omitempty"` // Function version Ensure that the version does not exceed 64 characters. Version string `json:"version,omitempty"` // The request protocol of the function. RequestProtocol string `json:"req_protocol,omitempty"` }
PolicyFuncGraph is an object which will be build up a backend policy of the function graph.
type PolicyFuncGraphResp ¶
type PolicyFuncGraphResp struct { // The policy ID of the FunctionGraph backend. ID string `json:"id"` // Policy conditions. Conditions []APIConditionBase `json:"conditions" required:"true"` // Effective mode of the backend policy. // ALL: All conditions are met. // ANY: Any condition is met. EffectMode string `json:"effect_mode" required:"true"` // Function URN. FunctionUrn string `json:"function_urn" required:"true"` // Function alias URN. FunctionAliasUrn string `json:"alias_urn"` // Network architecture type. NetworkType string `json:"network_type"` // The request protocol of the function. RequestProtocol string `json:"req_protocol"` // Invocation mode. The valid modes are as following: // async: asynchronous // sync: synchronous InvocationType string `json:"invocation_type" required:"true"` // The backend name, which can consists of 3 to 64 characters and must start with a letter and can contain letters, // digits, and underscores (_). Name string `json:"name" required:"true"` // Authorizer ID. AuthorizerId string `json:"authorizer_id,omitempty"` // Backend parameters. BackendParams []BackendParamResp `json:"backend_params,omitempty"` // Timeout, in ms, which allowed for API Gateway to request the backend service. // The valid value is range from 1 to 600,000. Timeout int `json:"timeout,omitempty"` // Function version Ensure that the version does not exceed 64 characters. Version string `json:"version,omitempty"` }
PolicyFuncGraphResp is an object struct that represents the back-end policy of function graph.
type PolicyMock ¶
type PolicyMock struct { // Policy conditions. Conditions []APIConditionBase `json:"conditions" required:"true"` // Effective mode of the backend policy. The valid modes are as following: // ALL: All conditions are met. // ANY: Any condition is met. EffectMode string `json:"effect_mode" required:"true"` // Backend name, which consists of 3 to 64 characters and must start with a letter and can contain letters, digits, // and underscores (_). Name string `json:"name" required:"true"` // The custom status code of the mock response. StatusCode int `json:"status_code,omitempty"` // Authorizer ID. AuthorizerId *string `json:"authorizer_id,omitempty"` // Backend parameters. BackendParams []BackendParamBase `json:"backend_params,omitempty"` // Response. ResultContent string `json:"result_content,omitempty"` }
PolicyMock is an object which will be build up a backend policy of the mock.
type PolicyMockResp ¶
type PolicyMockResp struct { // The policy ID of mock backend. ID string `json:"id"` // Policy conditions. Conditions []APIConditionBase `json:"conditions" required:"true"` // Effective mode of the backend policy. The valid modes are as following: // ALL: All conditions are met. // ANY: Any condition is met. EffectMode string `json:"effect_mode" required:"true"` // Backend name, which consists of 3 to 64 characters and must start with a letter and can contain letters, digits, // and underscores (_). Name string `json:"name" required:"true"` // The custom status code of the mock response. StatusCode int `json:"status_code"` // Authorizer ID. AuthorizerId string `json:"authorizer_id,omitempty"` // Backend parameters. BackendParams []BackendParamResp `json:"backend_params,omitempty"` // Response. ResultContent string `json:"result_content,omitempty"` }
PolicyMockResp is an object struct that represents the back-end policy of mock.
type PolicyWeb ¶
type PolicyWeb struct { // Request protocol. The value can be HTTP or HTTPS. ReqProtocol string `json:"req_protocol" required:"true"` // Request method. The valid methods are GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS and ANY. ReqMethod string `json:"req_method" required:"true"` // Request address, which can contain request parameters enclosed with brackets ({}). // For example, /getUserInfo/{userId}. The request address can contain special characters, such as asterisks (), // percent signs (%), hyphens (-), and underscores (_). It can contain a maximum of 512 characters and must comply // with URI specifications. // The request address can contain environment variables, each starting with a letter and consisting of 3 to 32 // characters. Only letters, digits, hyphens (-), and underscores (_) are allowed in environment variables. // The request address must comply with URI specifications. ReqURI string `json:"req_uri" required:"true"` // Effective mode of the backend policy. The valid modes are as following: // ALL: All conditions are met. // ANY: Any condition is met. EffectMode string `json:"effect_mode" required:"true"` // Backend name, which contains of 3 to 64, must start with a letter and can contain letters, digits, and // underscores (_). Name string `json:"name" required:"true"` // Policy conditions. Conditions []APIConditionBase `json:"conditions" required:"true"` // Backend parameters. BackendParams []BackendParamBase `json:"backend_params,omitempty"` // Authorizer ID. AuthorizerId *string `json:"authorizer_id,omitempty"` // VPC channel details. This parameter is required if vpc_channel_status is set to 1. VpcChannelInfo *VpcChannel `json:"vpc_channel_info,omitempty"` // Indicates whether to use a VPC channel. The valid value are as following: // 1: A VPC channel is used. // 2: No VPC channel is used. VpcChannelStatus int `json:"vpc_channel_status,omitempty"` // Endpoint of the policy backend. // An endpoint consists of a domain name or IP address and a port number, with not more than 255 characters. // It must be in the format "Domain name:Port number", for example, apig.example.com:7443. // If the port number is not specified, the default HTTPS port 443 or the default HTTP port 80 is used. // The endpoint can contain environment variables, each starting with letter and consisting of 3 to 32 characters. // Only letters, digits, hyphens (-), and underscores (_) are allowed. DomainURL string `json:"url_domain,omitempty"` // Timeout, in ms, which allowed for API Gateway to request the backend service. // The valid value is range from 1 to 600,000. Timeout int `json:"timeout,omitempty"` // Number of retry attempts to request the backend service. // The default value is –1, and the value ranges from –1 to 10. // –1 indicates that idempotent APIs will retry once and non-idempotent APIs will not retry. // POST and PATCH are non-idempotent. GET, HEAD, PUT, OPTIONS, and DELETE are idempotent. RetryCount *string `json:"retry_count,omitempty"` }
PolicyWeb is an object which will be build up a backend policy of the http.
type PolicyWebResp ¶
type PolicyWebResp struct { // The policy ID of the web backend. ID string `json:"id"` // Request protocol. The value can be HTTP or HTTPS. ReqProtocol string `json:"req_protocol" required:"true"` // Request method. The valid methods are GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS and ANY. ReqMethod string `json:"req_method" required:"true"` // Request address, which can contain request parameters enclosed with brackets ({}). For example, // /getUserInfo/{userId}. // The request address can contain special characters, such as asterisks (), percent signs (%), hyphens (-), and // underscores (_). It can contain a maximum of 512 characters and must comply with URI specifications. // The request address can contain environment variables, each starting with a letter and consisting of 3 to 32 // characters. Only letters, digits, hyphens (-), and underscores (_) are allowed in environment variables. // The request address must comply with URI specifications. ReqURI string `json:"req_uri" required:"true"` // Endpoint of the policy backend. // An endpoint consists of a domain name or IP address and a port number, with not more than 255 characters. // It must be in the format "Domain name:Port number", for example, apig.example.com:7443. // If the port number is not specified, the default HTTPS port 443 or the default HTTP port 80 is used. // The endpoint can contain environment variables, each starting with letter and consisting of 3 to 32 characters. // Only letters, digits, hyphens (-), and underscores (_) are allowed. DomainURL string `json:"url_domain,omitempty"` // Timeout, in ms, which allowed for API Gateway to request the backend service. // The valid value is range from 1 to 600,000. Timeout int `json:"timeout,omitempty"` // Number of retry attempts to request the backend service. // The default value is –1, and the value ranges from –1 to 10. // –1 indicates that idempotent APIs will retry once and non-idempotent APIs will not retry. // POST and PATCH are non-idempotent. GET, HEAD, PUT, OPTIONS, and DELETE are idempotent. RetryCount string `json:"retry_count"` // Effective mode of the backend policy. The valid modes are as following: // ALL: All conditions are met. // ANY: Any condition is met. EffectMode string `json:"effect_mode" required:"true"` // Backend name, which contains of 3 to 64 and must start with a letter and can contain letters, digits, and // underscores (_). Name string `json:"name" required:"true"` // Backend parameters. BackendParams []BackendParamResp `json:"backend_params,omitempty"` // Policy conditions. Conditions []APIConditionBase `json:"conditions" required:"true"` // Authorizer ID. AuthorizerId string `json:"authorizer_id,omitempty"` // VPC channel details. This parameter is required if vpc_channel_status is set to 1. VpcChannelInfo VpcChannel `json:"vpc_channel_info,omitempty"` // Indicates whether to use a VPC channel. The valid value are as following: // 1: A VPC channel is used. // 2: No VPC channel is used. VpcChannelEnable int `json:"vpc_channel_status,omitempty"` }
PolicyWebResp is an object struct that represents the back-end policy of http and https.
type PublishHistoriesPage ¶
type PublishHistoriesPage struct {
pagination.SinglePageBase
}
PublishHistoriesPage represents the publish history pages of the ListPublishHistories operation.
type PublishOpts ¶
type PublishOpts struct { // Operation to perform. // online: publishing the APIs // offline: taking the APIs offline Action string `json:"action" required:"true"` // ID of the environment in which the API will be published. EnvId string `json:"env_id" required:"true"` // ID of the API to be published or taken offline. ApiId string `json:"api_id" required:"true"` // Description about the operation, which can contain a maximum of 255 characters. // Chinese characters must be in UTF-8 or Unicode format. Description string `json:"remark,omitempty"` }
PublishOpts allows to publish a new version or offline an exist version for API using given parameters.
func (PublishOpts) ToPublishOptsMap ¶
func (opts PublishOpts) ToPublishOptsMap() (map[string]interface{}, error)
ToPublishOptsMap is a method which to build a request body by the ToPublishOptsMap.
type PublishOptsBuilder ¶
PublishOptsBuilder is an interface which to support request body build of the API publish method.
type PublishResp ¶
type PublishResp struct { // Publication record ID. PublishId string `json:"publish_id"` // API ID. ApiId string `json:"api_id"` // API name. ApiName string `json:"api_name"` // ID of the environment in which the API has been published. EnvId string `json:"env_id"` // Description about the publication. Description string `json:"remark"` // Publication time. PublishTime string `json:"publish_time"` // API version currently in use. VersionId string `json:"version_id"` }
PublishResp is a struct that represents the result of extract operation.
type PublishResult ¶
type PublishResult struct {
// contains filtered or unexported fields
}
PublishResult represents a result of the Publish method.
func Publish ¶
func Publish(client *golangsdk.ServiceClient, instanceId string, opts PublishOptsBuilder) (r PublishResult)
ToPublishOptsMap is a method which to publish a new version or offline an exist version for API.
func SwitchSpecVersion ¶
func SwitchSpecVersion(client *golangsdk.ServiceClient, instanceId, apiId, versionId string) (r PublishResult)
SwitchSpecVersion is a method which to switch a specified version.
func (PublishResult) Extract ¶
func (r PublishResult) Extract() (*PublishResp, error)
Extract is a method to extract an struct of publish response.
type ReqParamBase ¶
type ReqParamBase struct { // The parameter name, which contain of 1 to 32 characters and start with a letter. // Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. Name string `json:"name" required:"true"` // Parameter type. The valid types are as following: // STRING // NUMBER Type string `json:"type" required:"true"` // Parameter location. The valid modes are as following: // PATH // QUERY // HEADER Location string `json:"location" required:"true"` // Default value. DefaultValue *string `json:"default_value,omitempty"` // Example value. SampleValue string `json:"sample_value,omitempty"` // Indicates whether the parameter is required. The valid values are 1 (yes) and 2 (no). // The value of this parameter is 1 if Location is set to PATH, and 2 if Location is set to another value. Required int `json:"required,omitempty"` // Indicates whether validity check is enabled. The valid modes are as following: // 1: enabled. // 2: disabled (default). ValidEnable int `json:"valid_enable,omitempty"` // Description about the backend, which can contain a maximum of 255 characters. // Chinese characters must be in UTF-8 or Unicode format. Description *string `json:"remark,omitempty"` // Enumerated value. Enumerations *string `json:"enumerations,omitempty"` // Minimum value. // This parameter is valid when type is set to NUMBER. MinNum *int `json:"min_num,omitempty"` // Maximum value. // This parameter is valid when type is set to NUMBER. MaxNum *int `json:"max_num,omitempty"` // Minimum length. // This parameter is valid when type is set to STRING. MinSize *int `json:"min_size,omitempty"` // Maximum length. // This parameter is valid when type is set to STRING. MaxSize *int `json:"max_size,omitempty"` // Indicates whether to transparently transfer the parameter. The valid values are 1 (yes) and 2 (no). PassThrough int `json:"pass_through,omitempty"` // Request parameter orchestration rules are prioritized in the same sequence as the list. // The none_value rule in a rule list has the highest priority. A maximum of one none_value rule can be bound. // The default rule in a rule list has the lowest priority. A maximum of one default rule can be bound. // The preprocessing orchestration rule cannot be used as the last orchestration rule except the default rule. // Only one parameter of each API can be bound with unique orchestration rules. The number of orchestration rules that can be bound is limited by quota. For details, see "Notes and Constraints" in APIG Service Overview. Orchestrations []string `json:"orchestrations,omitempty"` }
ReqParamBase is an object which will be build up a front-end request parameter.
type ReqParamResp ¶
type ReqParamResp struct { // The parameter name, which contain of 1 to 32 characters and start with a letter. // Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. Name string `json:"name"` // Parameter type. The valid types are as following: // STRING // NUMBER Type string `json:"type"` // Parameter location. The valid modes are as following: // PATH // QUERY // HEADER Location string `json:"location"` // Default value. DefaultValue string `json:"default_value"` // Example value. SampleValue string `json:"sample_value"` // Indicates whether the parameter is required. The valid values are 1 (yes) and 2 (no). // The value of this parameter is 1 if Location is set to PATH, and 2 if Location is set to another value. Required int `json:"required"` // Indicates whether validity check is enabled. The valid modes are as following: // 1: enabled. // 2: disabled (default). ValidEnable int `json:"valid_enable"` // Description about the backend, which can contain a maximum of 255 characters. // Chinese characters must be in UTF-8 or Unicode format. Description string `json:"remark"` // Enumerated value. Enumerations string `json:"enumerations"` // Minimum value. // This parameter is valid when type is set to NUMBER. MinNum int `json:"min_num"` // Maximum value. // This parameter is valid when type is set to NUMBER. MaxNum int `json:"max_num"` // Minimum length. // This parameter is valid when type is set to STRING. MinSize int `json:"min_size"` // Maximum length. // This parameter is valid when type is set to STRING. MaxSize int `json:"max_size"` // Indicates whether to transparently transfer the parameter. The valid values are 1 (yes) and 2 (no). PassThrough int `json:"pass_through"` // Parameter ID. // Notes: This parameter is used for response. ID string `json:"id"` // Request parameter orchestration rules are prioritized in the same sequence as the list. // The none_value rule in a rule list has the highest priority. A maximum of one none_value rule can be bound. // The default rule in a rule list has the lowest priority. A maximum of one default rule can be bound. // The preprocessing orchestration rule cannot be used as the last orchestration rule except the default rule. // Only one parameter of each API can be bound with unique orchestration rules. The number of orchestration rules that can be bound is limited by quota. For details, see "Notes and Constraints" in APIG Service Overview. Orchestrations []string `json:"orchestrations"` }
ReqParamResp is an object struct that represents the elements of the front-end request parameter.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents a result of the Update method.
func Update ¶
func Update(client *golangsdk.ServiceClient, instanceId, appId string, opts APIOptsBuilder) (r UpdateResult)
Update is a method to update an existing custom API.
type VersionSwitchOpts ¶
type VersionSwitchOpts struct { // API version ID. VersionId string `json:"version_id,omitempty"` }
VersionSwitchOpts allows to switch a specified version using version ID.
func (VersionSwitchOpts) ToVersionSwitchOptsMap ¶
func (opts VersionSwitchOpts) ToVersionSwitchOptsMap() (map[string]interface{}, error)
ToVersionSwitchOptsMap is a method which to build a request body by the VersionSwitchOpts.
type VersionSwitchOptsBuilder ¶
type VersionSwitchOptsBuilder interface {
ToVersionSwitchOptsMap() (map[string]interface{}, error)
}
VersionSwitchOptsBuilder is an interface which to support request body build of the API version switch method.
type VpcChannel ¶
type VpcChannel struct { // VPC channel ID. VpcChannelId string `json:"vpc_channel_id" required:"true"` // Proxy host. VpcChannelProxyHost string `json:"vpc_channel_proxy_host,omitempty"` }
VpcChannel is an object which will be build up a vpc channel.
type Web ¶
type Web struct { // The ID of the backend configration. ID string `json:"id,omitempty"` // Request method. The valid methods are GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS and ANY. ReqMethod string `json:"req_method" required:"true"` // Request protocol. The valid protocols are HTTP and HTTPS ReqProtocol string `json:"req_protocol" required:"true"` // Request address, which can contain a maximum of 512 characters request parameters enclosed with brackets ({}). // For example, /getUserInfo/{userId}. // The request address can contain special characters, such as asterisks (*), percent signs (%), hyphens (-), and // underscores (_) and must comply with URI specifications. // The address can contain environment variables, each starting with a letter and consisting of 3 to 32 characters. // Only letters, digits, hyphens (-), and underscores (_) are allowed in environment variables. ReqURI string `json:"req_uri" required:"true"` // Timeout, in ms, which allowed for API Gateway to request the backend service. // The valid value is range from 1 to 600,000. Timeout int `json:"timeout" required:"true"` // Backend custom authorizer ID. AuthorizerId *string `json:"authorizer_id,omitempty"` // Backend service address which consists of a domain name or IP address and a port number, with not more than 255 // characters. It must be in the format "Host name:Port number", for example, apig.example.com:7443. // If the port number is not specified, the default HTTPS port 443 or the default HTTP port 80 is used. // The backend service address can contain environment variables, each starting with a letter and consisting of // 3 to 32 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. DomainURL string `json:"url_domain,omitempty"` // Description, which can contain a maximum of 255 characters. // Chinese characters must be in UTF-8 or Unicode format. Description *string `json:"remark,omitempty"` // Web backend version, which can contain a maximum of 16 characters. Version *string `json:"version,omitempty"` // Indicates whether to enable two-way authentication. ClientSslEnable *bool `json:"enable_client_ssl,omitempty"` // VPC channel details. This parameter is required if vpc_channel_status is set to 1. VpcChannelInfo *VpcChannel `json:"vpc_channel_info,omitempty"` // Indicates whether to use a VPC channel. The valid values are as following: // 1: (A VPC channel is used). // 2: (No VPC channel is used). VpcChannelStatus int `json:"vpc_channel_status,omitempty"` // Number of retry attempts to request the backend service. // The default value is –1, and the value ranges from –1 to 10. // –1 indicates that idempotent APIs will retry once and non-idempotent APIs will not retry. // POST and PATCH are non-idempotent. GET, HEAD, PUT, OPTIONS, and DELETE are idempotent. RetryCount *string `json:"retry_count,omitempty"` }
Web is an object which will be build up a http backend.