nhnutil

package
v0.0.0-...-c04fabd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindIpACLGroupToLoadBalancer

func BindIpACLGroupToLoadBalancer(region Region, lbId string, bindings IPACLGroupsBinding) (string, error)

Bind IP access control list group (IP ACL group) to load balancer

func CheckResponse

func CheckResponse(resp *resty.Response) error

func CreateIpACLGroup

func CreateIpACLGroup(region Region, group IPACLGroup) (string, error)

Create an IP access control list group (IP ACL group)

func CreateIpACLTarget

func CreateIpACLTarget(region Region, target IPACLTarget) (string, error)

Create IP access control list target (IP ACL target)

func CreateSecurityGroupRule

func CreateSecurityGroupRule(region Region, rule SecurityGroupRule) (string, error)

Create a security group rule

func DeleteIpACLGroup

func DeleteIpACLGroup(region Region, groupId string) error

Delete IP access control list group (IP ACL group)

func DeleteIpACLTarget

func DeleteIpACLTarget(region Region, targetId string) error

Delete IP access control list target (IP ACL target)

func DeleteSecurityGroupRule

func DeleteSecurityGroupRule(region Region, securityGroupRuleId string) error

Delete a security group rule

func GetIpACLGroups

func GetIpACLGroups(region Region) (string, error)

Get IP access control list groups (IP ACL groups)

func GetIpACLTargets

func GetIpACLTargets(region Region) (string, error)

Get IP access control list targets (IP ACL targets)

func GetLoadBalancers

func GetLoadBalancers(region Region) (string, error)

Get load balancers

func GetNetworkACLs

func GetNetworkACLs(region Region) (string, error)

Get Networks ACLs

func GetSecurityGroup

func GetSecurityGroup(region Region, securityGroupId string) (string, error)

Get a security group

func GetSecurityGroups

func GetSecurityGroups(region Region) (string, error)

GetSecurityGroups function gets a security group.

func GetToken

func GetToken() (string, error)

func GetTokenId

func GetTokenId() (string, error)

func Init

func Init(config Config)

func SetTokenId

func SetTokenId() error

Types

type Access

type Access struct {
	Token          Token            `json:"token"`
	ServiceCatalog []ServiceCatalog `json:"serviceCatalog"`
	User           User             `json:"user"`
	Metadata       Metadata         `json:"metadata"`
}

type Auth

type Auth struct {
	TenantId            string              `json:"tenantId"`
	PasswordCredentials PasswordCredentials `json:"passwordCredentials"`
}

type AuthResponse

type AuthResponse struct {
	Access Access `json:"access"`
}

POST /v2.0/tokens - response body

type BoundPair

type BoundPair struct {
	LoadBalancerId string `json:"loadbalancer_id"`
	IpaclGroupId   string `json:"ipacl_group_id"`
}

type Config

type Config struct {
	TenantId    string
	Username    string
	ApiPassword string
}

type Endpoint

type Endpoint struct {
	PublicURL string `json:"publicURL"`
	Region    string `json:"region"`
}

type IPACLGroup

type IPACLGroup struct {
	IpaclGroup IPACLGroupDetails `json:"ipacl_group"`
}

type IPACLGroupDetails

type IPACLGroupDetails struct {
	IpaclTargetCount string           `json:"ipacl_target_count,omitempty"`
	Description      string           `json:"description,omitempty"`
	LoadBalancers    []LoadBalancerId `json:"loadbalancers,omitempty"`
	TenantId         string           `json:"tenant_id,omitempty"`
	Action           string           `json:"action,omitempty"`
	Id               string           `json:"id,omitempty"`
	Name             string           `json:"name,omitempty"`
}

type IPACLGroupId

type IPACLGroupId struct {
	IpaclGroupId string `json:"ipacl_group_id"`
}

type IPACLGroups

type IPACLGroups struct {
	IpaclGroups []IPACLGroupDetails `json:"ipacl_groups"`
}

Models for IP ACL groups

type IPACLGroupsBinding

type IPACLGroupsBinding struct {
	IpaclGroupsBinding []IPACLGroupId `json:"ipacl_groups_binding"`
}

Models for Binding LoadBalancer and IP ACL groups

type IPACLTarget

type IPACLTarget struct {
	IpaclTarget IPACLTargetDetails `json:"ipacl_target"`
}

type IPACLTargetDetails

type IPACLTargetDetails struct {
	IpaclGroupId string `json:"ipacl_group_id"`
	TenantId     string `json:"tenant_id,omitempty"`
	CIDRAddress  string `json:"cidr_address"`
	Description  string `json:"description"`
	Id           string `json:"id,omitempty"`
}

type IPACLTargets

type IPACLTargets struct {
	IpaclTargets []IPACLTargetDetails `json:"ipacl_targets"`
}

type Listener

type Listener struct {
	Id string `json:"id"`
}

type LoadBalancerDetails

type LoadBalancerDetails struct {
	IpaclGroupAction   string         `json:"ipacl_group_action"`
	Description        string         `json:"description"`
	ProvisioningStatus string         `json:"provisioning_status"`
	TenantID           string         `json:"tenant_id"`
	Provider           string         `json:"provider"`
	IpaclGroups        []IPACLGroupId `json:"ipacl_groups"`
	Name               string         `json:"name"`
	LoadBalancerType   string         `json:"loadbalancer_type"`
	Listeners          []Listener     `json:"listeners"`
	VipAddress         string         `json:"vip_address"`
	VipPortID          string         `json:"vip_port_id"`
	WorkflowStatus     string         `json:"workflow_status"`
	VipSubnetID        string         `json:"vip_subnet_id"`
	Id                 string         `json:"id"`
	OperatingStatus    string         `json:"operating_status"`
	AdminStateUp       bool           `json:"admin_state_up"`
}

type LoadBalancerId

type LoadBalancerId struct {
	LoadBalancerId string `json:"loadbalancer_id"`
}

type LoadBalancers

type LoadBalancers struct {
	LoadBalancers []LoadBalancerDetails `json:"loadbalancers"`
}

Model for load balancer

type Metadata

type Metadata struct {
	Roles   []string `json:"roles"`
	IsAdmin int      `json:"is_admin"`
}

type NetworkACLDetails

type NetworkACLDetails struct {
	Id             string `json:"id"`
	Name           string `json:"name"`
	Description    string `json:"description"`
	TenantId       string `json:"tenant_id"`
	CreatedAt      string `json:"created_at"`
	UpdatedAt      string `json:"updated_at"`
	RevisionNumber int    `json:"revision_number"`
}

type NetworkACLs

type NetworkACLs struct {
	NetworkACL []NetworkACLDetails `json:"acls"`
}

Model for Network ACLs

type PasswordCredentials

type PasswordCredentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Region

type Region string

Define type for region

const (
	KR1 Region = "kr1"
	KR2 Region = "kr2"
	KR3 Region = "jp1"
)

Define const for region

type ResourceType

type ResourceType string

Define type for resource type

const (
	Instance    ResourceType = "instance"
	Network     ResourceType = "network"
	Image       ResourceType = "image"
	Volumev2    ResourceType = "block-storage"
	ObjectStore ResourceType = "object-storage"
	KeyManager  ResourceType = "key-manager"
)

Define const for resource type

type Role

type Role struct {
	Name string `json:"name"`
}
type RoleLink struct {
}

type SecurityGroup

type SecurityGroup struct {
	SecurityGroup SecurityGroupDetails `json:"security_group"`
}

type SecurityGroupDetails

type SecurityGroupDetails struct {
	TenantId           string                     `json:"tenant_id,omitempty"`
	Description        string                     `json:"description"`
	Id                 string                     `json:"id"`
	SecurityGroupRules []SecurityGroupRuleDetails `json:"security_group_rules"`
	Name               string                     `json:"name"`
}

type SecurityGroupRule

type SecurityGroupRule struct {
	SecurityGroupRule SecurityGroupRuleDetailsExt `json:"security_group_rule"`
}

type SecurityGroupRuleDetails

type SecurityGroupRuleDetails struct {
	Direction       string  `json:"direction" default:"ingress"`
	Protocol        string  `json:"protocol" default:"tcp"`
	Description     string  `json:"description"`
	PortRangeMax    int     `json:"port_range_max"`
	Id              string  `json:"id,omitempty"`
	RemoteGroupId   *string `json:"remote_group_id,omitempty"`
	RemoteIpPrefix  string  `json:"remote_ip_prefix"`
	SecurityGroupId string  `json:"security_group_id"`
	TenantId        string  `json:"tenant_id,omitempty"`
	PortRangeMin    int     `json:"port_range_min"`
	Ethertype       string  `json:"ethertype"`
}

type SecurityGroupRuleDetailsExt

type SecurityGroupRuleDetailsExt struct {
	Direction       string `json:"direction" default:"ingress"`
	Protocol        string `json:"protocol" default:"tcp"`
	Description     string `json:"description"`
	PortRangeMax    int    `json:"port_range_max"`
	Id              string `json:"id,omitempty"`
	RemoteGroupId   string `json:"remote_group_id,omitempty"`
	RemoteIpPrefix  string `json:"remote_ip_prefix"`
	SecurityGroupId string `json:"security_group_id"`
	TenantId        string `json:"tenant_id,omitempty"`
	PortRangeMin    int    `json:"port_range_min"`
	Ethertype       string `json:"ethertype"`
	UpdatedAt       string `json:"updated_at,omitempty"`
	RevisionNumber  int    `json:"revision_number,omitempty"`
	CreatedAt       string `json:"created_at,omitempty"`
	ProjectId       string `json:"project_id,omitempty"`
}

type SecurityGroups

type SecurityGroups struct {
	SecurityGroups []SecurityGroupDetails `json:"security_groups"`
}

Get /v2.0/security-groups - response body

type ServiceCatalog

type ServiceCatalog struct {
	Endpoints []Endpoint `json:"endpoints"`
	Type      string     `json:"type"`
	Name      string     `json:"name"`
}

type Tenant

type Tenant struct {
	ID                    string `json:"id"`
	Name                  string `json:"name"`
	GroupID               string `json:"groupId"`
	Description           string `json:"description"`
	Enabled               bool   `json:"enabled"`
	ProjectDomain         string `json:"project_domain"`
	RegionOneSDNPreferred string `json:"RegionOne_sdn_preferred"`
}

type Token

type Token struct {
	ID       string `json:"id"`
	Expires  string `json:"expires"`
	Tenant   Tenant `json:"tenant"`
	IssuedAt string `json:"issued_at"`
}

type TokenRequest

type TokenRequest struct {
	Auth Auth `json:"auth"`
}

POST /v2.0/tokens - request body

type User

type User struct {
	ID         string     `json:"id"`
	Username   string     `json:"username"`
	Name       string     `json:"name"`
	Roles      []Role     `json:"roles"`
	RolesLinks []RoleLink `json:"roles_links"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL