Documentation
¶
Index ¶
- Constants
- type AccessPolicy
- type Client
- func (c *Client) CreateAccessPolicy(accountID, userID, clusterID string) (string, error)
- func (c *Client) CreateCloudDirectoryUser(username string) (*CloudDirectoryUser, error)
- func (c *Client) CreateCluster(name, zone string, noSubnet bool) (*IBMCloudClusterRequest, error)
- func (c *Client) DeleteAccessPolicy(id string) error
- func (c *Client) DeleteCloudDirectoryUser(id string) error
- func (c *Client) DeleteCluster(id string) error
- func (c *Client) DeleteIAMUser(id string) error
- func (c *Client) GetCluster(id string) (*Cluster, error)
- func (c *Client) GetIAMUserByUserID(userID string) (*IAMUser, error)
- func (c *Client) GetToken() TokenSet
- func (c *Client) GetVlans(zone string) ([]Vlan, error)
- func (c *Client) GetZones() ([]Location, error)
- func (c *Client) Token() (TokenSet, error)
- func (c *Client) UpdateCloudDirectoryUserPassword(id string) (*CloudDirectoryUser, error)
- type CloudDirectoryUser
- type Cluster
- type Configuration
- type IAMUser
- type IAMUserResult
- type IBMCloudClusterRequest
- type ICClient
- type ID
- type Ingress
- type Location
- type TokenSet
- type Value
- type Vlan
Constants ¶
const AccessPolicyTemplate = `` /* 544-byte string literal not displayed */
const CloudDirectoryUserTemplate = `{"active":true, "emails":[{"value":"%s", "primary":true}], "userName":"%s", "password":"%s"}`
const ClusterConfigTemplate = `` /* 216-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessPolicy ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(config Configuration) *Client
func (*Client) CreateAccessPolicy ¶
CreateAccessPolicy creates an access policy for the cluster and assigns it to the user. Returns the id of the created policy.
func (*Client) CreateCloudDirectoryUser ¶
func (c *Client) CreateCloudDirectoryUser(username string) (*CloudDirectoryUser, error)
CreateCloudDirectoryUser creates a new cloud directory user with the given username and generated email and password. If the given username is an empty string then it will be generated too.
func (*Client) CreateCluster ¶
func (c *Client) CreateCluster(name, zone string, noSubnet bool) (*IBMCloudClusterRequest, error)
CreateCluster creates a cluster Returns the cluster ID
func (*Client) DeleteAccessPolicy ¶
DeleteAccessPolicy deletes the access policy with the specified ID.
func (*Client) DeleteCloudDirectoryUser ¶
DeleteCloudDirectoryUser deletes the cloud directory user with the given ID.
func (*Client) DeleteCluster ¶
DeleteCluster deletes the cluster with the given ID/name
func (*Client) DeleteIAMUser ¶
DeleteIAMUser deletes the AIM user with the corresponding id (IAMUser.ID).
func (*Client) GetCluster ¶
GetCluster fetches the cluster with the given ID/name
func (*Client) GetIAMUserByUserID ¶
GetIAMUserByUserID fetches the AIM user with the corresponding user_id. Returns a Not Found Error if the user is not found.
func (*Client) Token ¶
Token returns IBM Cloud Token. If the token is expired or not obtained yet it will obtain a new one.
func (*Client) UpdateCloudDirectoryUserPassword ¶
func (c *Client) UpdateCloudDirectoryUserPassword(id string) (*CloudDirectoryUser, error)
UpdateCloudDirectoryUserPassword sets a new generated password for the user with the given ID
type CloudDirectoryUser ¶
type CloudDirectoryUser struct {
ID string `json:"id"`
Username string `json:"userName"`
Emails []Value `json:"emails"`
ProfileID string `json:"profileId"`
Password string
}
func (*CloudDirectoryUser) Email ¶
func (u *CloudDirectoryUser) Email() string
type Cluster ¶
type Cluster struct {
ID string `json:"id"`
Name string `json:"name"`
Region string `json:"region"`
CreatedDate string `json:"createdDate"`
MasterKubeVersion string `json:"masterKubeVersion"`
WorkerCount int `json:"workerCount"`
Location string `json:"location"`
Datacenter string `json:"datacenter"`
State string `json:"state"`
Type string `json:"type"`
Crn string `json:"crn"`
Ingress Ingress `json:"ingress"`
MasterURL string `json:"masterURL"`
}
type Configuration ¶
type IAMUserResult ¶
type IBMCloudClusterRequest ¶
type ICClient ¶
type ICClient interface {
GetVlans(zone string) ([]Vlan, error)
GetZones() ([]Location, error)
CreateCluster(name, zone string, noSubnet bool) (*IBMCloudClusterRequest, error)
GetCluster(id string) (*Cluster, error)
DeleteCluster(id string) error
CreateCloudDirectoryUser(username string) (*CloudDirectoryUser, error)
UpdateCloudDirectoryUserPassword(id string) (*CloudDirectoryUser, error)
GetIAMUserByUserID(userID string) (*IAMUser, error)
CreateAccessPolicy(accountID, userID, clusterID string) (string, error)
DeleteAccessPolicy(id string) error
}