Documentation
¶
Index ¶
- func Delete(client *golangsdk.ServiceClient, gatewayID, aclID string) (err error)
- func UnbindPolicy(client *golangsdk.ServiceClient, gatewayID, aclBindId string) (err error)
- type AclPage
- type AclResp
- func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*AclResp, error)
- func ExtractAcls(r pagination.NewPage) ([]AclResp, error)
- func Get(client *golangsdk.ServiceClient, gatewayID, aclID string) (*AclResp, error)
- func List(client *golangsdk.ServiceClient, opts ListOpts) ([]AclResp, error)
- func Update(client *golangsdk.ServiceClient, aclID string, opts CreateOpts) (*AclResp, error)
- type ApiAcl
- type ApiBindAclInfo
- type BindAclResp
- type BindOpts
- type BindingPage
- type CreateOpts
- type ListBindingOpts
- type ListBoundOpts
- type ListOpts
- type ListUnoundOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnbindPolicy ¶
func UnbindPolicy(client *golangsdk.ServiceClient, gatewayID, aclBindId string) (err error)
Types ¶
type AclPage ¶
type AclPage struct {
pagination.NewSinglePageBase
}
type AclResp ¶
type AclResp struct {
// Name
Name string `json:"acl_name"`
// Type.
// PERMIT (whitelist)
// DENY (blacklist)
Type string `json:"acl_type"`
// Access control objects.
Value string `json:"acl_value"`
// Object type.
// IP
// DOMAIN
// DOMAIN_ID
EntityType string `json:"entity_type"`
// ID.
ID string `json:"id"`
// Update time.
UpdateTime string `json:"update_time"`
// Number of bounded APIs.
BindNum int `json:"bind_num"`
}
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*AclResp, error)
func ExtractAcls ¶
func ExtractAcls(r pagination.NewPage) ([]AclResp, error)
func Update ¶
func Update(client *golangsdk.ServiceClient, aclID string, opts CreateOpts) (*AclResp, error)
type ApiAcl ¶
type ApiAcl struct {
// API ID.
ApiId string `json:"api_id"`
// API name.
ApiName string `json:"api_name"`
// API type.
ApiType int `json:"api_type"`
// API description.
ApiDescription string `json:"api_remark"`
// ID of the environment in which the policy takes effect.
EnvId string `json:"env_id"`
// Name of the environment in which the policy takes effect.
EnvName string `json:"env_name"`
// Binding record ID.
BindingId string `json:"bind_id"`
// API group name.
GroupName string `json:"group_name"`
// Binding time.
BindedAt string `json:"bind_time"`
// API publication record ID.
PublishId string `json:"publish_id"`
// Request method.
ReqMethod string `json:"req_method"`
}
func ExtractBindings ¶
func ExtractBindings(r pagination.NewPage) ([]ApiAcl, error)
func ListAPIBoundPolicy ¶
func ListAPIBoundPolicy(client *golangsdk.ServiceClient, opts ListBoundOpts) ([]ApiAcl, error)
func ListAPIUnoundPolicy ¶
func ListAPIUnoundPolicy(client *golangsdk.ServiceClient, opts ListBoundOpts) ([]ApiAcl, error)
type ApiBindAclInfo ¶
type ApiBindAclInfo struct {
// Access control policy ID.
AclId string `json:"acl_id"`
// Access control policy name.
AclName string `json:"acl_name"`
// Object type.
// Enumeration values:
// IP
// DOMAIN
// DOMAIN_ID
EntityType string `json:"entity_type"`
// Access control type.
// PERMIT: whitelist
// DENY: blacklist
AclType string `json:"acl_type"`
// Access control objects.
AclValue string `json:"acl_value"`
// Effective environment ID.
EnvId string `json:"env_id"`
// Effective environment name.
EnvName string `json:"env_name"`
// Binding record ID.
BindID string `json:"bind_id"`
// Binding time.
BindTime string `json:"bind_time"`
}
func ExtractPolicies ¶
func ExtractPolicies(r pagination.NewPage) ([]ApiBindAclInfo, error)
func ListBoundPolicies ¶
func ListBoundPolicies(client *golangsdk.ServiceClient, opts ListBindingOpts) ([]ApiBindAclInfo, error)
type BindAclResp ¶
type BindAclResp struct {
// Binding record ID.
ID string `json:"id"`
// API ID.
ApiId string `json:"api_id"`
// Environment ID.
EnvId string `json:"env_id"`
// Access control policy ID.
PolicyID string `json:"acl_id"`
// Binding time.
AppliedAt string `json:"create_time"`
}
func BindPolicy ¶
func BindPolicy(client *golangsdk.ServiceClient, opts BindOpts) ([]BindAclResp, error)
type BindingPage ¶
type BindingPage struct {
pagination.NewSinglePageBase
}
type CreateOpts ¶
type CreateOpts struct {
GatewayID string `json:"-"`
// Access control policy name. It can contain 3 to 64 characters, starting with a letter.
// Only letters, digits, and underscores (_) are allowed.
Name string `json:"acl_name" required:"true"`
// Type.
// PERMIT (whitelist)
// DENY (blacklist)
Type string `json:"acl_type" required:"true"`
// One or more objects from which the access will be controlled. Separate multiple objects with commas.
// If entity_type is set to IP, enter up to 100 IP addresses.
// If entity_type is set to DOMAIN, enter account names.
// Each account name can contain up to 64 ASCII characters except commas (,).
// Do not use only digits. The total length cannot exceed 1024 characters.
// If entity_type is set to DOMAIN_ID, enter account IDs.
Value string `json:"acl_value" required:"true"`
// Object type.
// IP: IP address.
// DOMAIN: Account name.
// DOMAIN_ID: Account ID.
EntityType string `json:"entity_type" required:"true"`
}
type ListBindingOpts ¶
type ListBindingOpts struct {
GatewayID string `json:"-"`
// Offset from which the query starts. If the value is less than 0, it is automatically converted to 0.
Offset *int `q:"offset"`
// Number of items displayed on each page.
// A value less than or equal to 0 will be automatically converted to 20,
// and a value greater than 500 will be automatically converted to 500.
Limit int `q:"limit"`
// API ID.
ApiId string `q:"api_id" required:"true"`
// Environment ID.
EnvId string `q:"env_id"`
// Environment name.
EnvName string `q:"env_name"`
// Access control policy ID.
PolicyId string `q:"acl_id"`
// Access control policy name.
PolicyName string `q:"acl_name"`
}
type ListBoundOpts ¶
type ListBoundOpts struct {
GatewayID string `json:"-"`
// Offset from which the query starts. If the value is less than 0, it is automatically converted to 0.
Offset *int `q:"offset"`
// Number of items displayed on each page.
// A value less than or equal to 0 will be automatically converted to 20,
// and a value greater than 500 will be automatically converted to 500.
Limit int `q:"limit"`
// Access control policy ID.
ID string `q:"acl_id" required:"true"`
// API ID.
ApiId string `q:"api_id"`
// API name.
ApiName string `q:"api_name"`
// Environment ID.
EnvId string `q:"env_id"`
// API group ID.
GroupId string `q:"group_id"`
}
type ListOpts ¶
type ListOpts struct {
GatewayID string `json:"-"`
// Offset from which the query starts. If the value is less than 0, it is automatically converted to 0.
Offset *int `q:"offset"`
// Number of items displayed on each page.
// A value less than or equal to 0 will be automatically converted to 20,
// and a value greater than 500 will be automatically converted to 500.
Limit int `q:"limit"`
// Access control policy ID.
ID string `q:"id"`
// Access control policy name.
Name string `q:"name"`
// Type.
// PERMIT (whitelist)
// DENY (blacklist)
Type string `q:"acl_type"`
// Object types.
// IP
// DOMAIN
EntityType string `q:"entity_type"`
// Parameter name (name) for exact matching.
PreciseSearch string `q:"precise_search"`
}
type ListUnoundOpts ¶
type ListUnoundOpts struct {
GatewayID string `json:"-"`
// Offset from which the query starts. If the value is less than 0, it is automatically converted to 0.
Offset *int `q:"offset"`
// Number of items displayed on each page.
// A value less than or equal to 0 will be automatically converted to 20,
// and a value greater than 500 will be automatically converted to 500.
Limit int `q:"limit"`
// Access control policy ID.
ID string `q:"acl_id" required:"true"`
// API ID.
ApiId string `q:"api_id"`
// API name.
ApiName string `q:"api_name"`
// Environment ID.
EnvId string `q:"env_id"`
// API group ID.
GroupId string `q:"group_id"`
}
Click to show internal directories.
Click to hide internal directories.