Documentation
¶
Index ¶
- Variables
- func EnsureToken(profile string, cfg *config.Config, creds *config.CredentialsStore, ...) (string, error)
- func SetDebugLevel(level DebugLevel)
- type AuthResponse
- type Client
- func (c *Client) BaseURL(service string) string
- func (c *Client) Delete(url string) error
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) Get(url string, result any) error
- func (c *Client) Post(url string, body, result any) (*http.Response, error)
- func (c *Client) Put(url string, body, result any) error
- func (c *Client) Request(method, url string, body any) (*http.Response, error)
- type ComputeAPI
- func (a *ComputeAPI) AddSecurityGroup(id, name string) error
- func (a *ComputeAPI) AttachVolume(serverID, volumeID string) error
- func (a *ComputeAPI) CreateKeypair(req *model.KeypairCreateRequest) (*model.Keypair, error)
- func (a *ComputeAPI) CreateServer(req *model.ServerCreateRequest) (*model.Server, error)
- func (a *ComputeAPI) DeleteKeypair(name string) error
- func (a *ComputeAPI) DeleteServer(id string) error
- func (a *ComputeAPI) DetachVolume(serverID, volumeID string) error
- func (a *ComputeAPI) FindServer(idOrName string) (*model.Server, error)
- func (a *ComputeAPI) GetConsole(id string) (*model.RemoteConsoleResponse, error)
- func (a *ComputeAPI) GetFlavor(id string) (*model.Flavor, error)
- func (a *ComputeAPI) GetKeypair(name string) (*model.Keypair, error)
- func (a *ComputeAPI) GetServer(id string) (*model.Server, error)
- func (a *ComputeAPI) GetServerMetadata(id string) (map[string]string, error)
- func (a *ComputeAPI) ListFlavors() ([]model.Flavor, error)
- func (a *ComputeAPI) ListKeypairs() ([]model.Keypair, error)
- func (a *ComputeAPI) ListServers() ([]model.Server, error)
- func (a *ComputeAPI) ListVolumeAttachments(serverID string) ([]model.VolumeAttachment, error)
- func (a *ComputeAPI) RebootServer(id string, hard bool) error
- func (a *ComputeAPI) RebuildServer(id, imageID string) error
- func (a *ComputeAPI) RemoveSecurityGroup(id, name string) error
- func (a *ComputeAPI) ResizeServer(id, flavorID string) error
- func (a *ComputeAPI) ServerAction(id string, action map[string]any) error
- func (a *ComputeAPI) StartServer(id string) error
- func (a *ComputeAPI) StopServer(id string) error
- func (a *ComputeAPI) UpdateServerMetadata(id string, meta map[string]string) (map[string]string, error)
- type DNSAPI
- func (a *DNSAPI) CreateDomain(name, email string, ttl int) (*model.Domain, error)
- func (a *DNSAPI) CreateRecord(domainID, name, recordType, data string, ttl int, priority *int) (*model.Record, error)
- func (a *DNSAPI) DeleteDomain(id string) error
- func (a *DNSAPI) DeleteRecord(domainID, recordID string) error
- func (a *DNSAPI) GetDomain(id string) (*model.Domain, error)
- func (a *DNSAPI) ListDomains() ([]model.Domain, error)
- func (a *DNSAPI) ListRecords(domainID string) ([]model.Record, error)
- func (a *DNSAPI) UpdateDomain(id string, body map[string]any) error
- func (a *DNSAPI) UpdateRecord(domainID, recordID string, body map[string]any) error
- type DebugLevel
- type IdentityAPI
- func (a *IdentityAPI) CreateCredential(credType, blob, userID string) (*model.Credential, error)
- func (a *IdentityAPI) CreateSubUser(name, password string) (*model.SubUser, error)
- func (a *IdentityAPI) DeleteCredential(id string) error
- func (a *IdentityAPI) DeleteSubUser(id string) error
- func (a *IdentityAPI) GetCredential(id string) (*model.Credential, error)
- func (a *IdentityAPI) ListCredentials() ([]model.Credential, error)
- func (a *IdentityAPI) ListRoles() ([]model.Role, error)
- func (a *IdentityAPI) ListSubUsers() ([]model.SubUser, error)
- func (a *IdentityAPI) UpdateSubUser(id string, body map[string]any) error
- type ImageAPI
- func (a *ImageAPI) CreateImage(name, diskFormat, containerFormat string) (*model.Image, error)
- func (a *ImageAPI) DeleteImage(id string) error
- func (a *ImageAPI) GetImage(id string) (*model.Image, error)
- func (a *ImageAPI) ListImages() ([]model.Image, error)
- func (a *ImageAPI) UploadImageFile(id string, reader io.Reader, size int64) error
- type LoadBalancerAPI
- func (a *LoadBalancerAPI) CreateHealthMonitor(poolID, name, monitorType string, delay, timeout, maxRetries int, ...) (*model.HealthMonitor, error)
- func (a *LoadBalancerAPI) CreateListener(name, protocol string, port int, lbID string) (*model.Listener, error)
- func (a *LoadBalancerAPI) CreateLoadBalancer(name, subnetID string) (*model.LoadBalancer, error)
- func (a *LoadBalancerAPI) CreateMember(poolID, name, address string, port int, weight *int) (*model.Member, error)
- func (a *LoadBalancerAPI) CreatePool(name, protocol, lbAlgorithm, listenerID string) (*model.Pool, error)
- func (a *LoadBalancerAPI) DeleteHealthMonitor(id string) error
- func (a *LoadBalancerAPI) DeleteListener(id string) error
- func (a *LoadBalancerAPI) DeleteLoadBalancer(id string) error
- func (a *LoadBalancerAPI) DeleteMember(poolID, memberID string) error
- func (a *LoadBalancerAPI) DeletePool(id string) error
- func (a *LoadBalancerAPI) GetHealthMonitor(id string) (*model.HealthMonitor, error)
- func (a *LoadBalancerAPI) GetListener(id string) (*model.Listener, error)
- func (a *LoadBalancerAPI) GetLoadBalancer(id string) (*model.LoadBalancer, error)
- func (a *LoadBalancerAPI) GetMember(poolID, memberID string) (*model.Member, error)
- func (a *LoadBalancerAPI) GetPool(id string) (*model.Pool, error)
- func (a *LoadBalancerAPI) ListHealthMonitors() ([]model.HealthMonitor, error)
- func (a *LoadBalancerAPI) ListListeners() ([]model.Listener, error)
- func (a *LoadBalancerAPI) ListLoadBalancers() ([]model.LoadBalancer, error)
- func (a *LoadBalancerAPI) ListMembers(poolID string) ([]model.Member, error)
- func (a *LoadBalancerAPI) ListPools() ([]model.Pool, error)
- func (a *LoadBalancerAPI) UpdateLoadBalancer(id string, body map[string]any) error
- type NetworkAPI
- func (a *NetworkAPI) AttachPort(computeClient *Client, serverID, portID string) error
- func (a *NetworkAPI) CreateNetwork(name string) (*model.Network, error)
- func (a *NetworkAPI) CreatePort(networkID, name string) (*model.Port, error)
- func (a *NetworkAPI) CreateSecurityGroup(name, description string) (*model.SecurityGroup, error)
- func (a *NetworkAPI) CreateSecurityGroupRule(sgID, direction, protocol, ethertype string, portMin, portMax *int, ...) (*model.SecurityGroupRule, error)
- func (a *NetworkAPI) CreateSubnet(networkID, cidr, name string, ipVersion int) (*model.Subnet, error)
- func (a *NetworkAPI) DeleteNetwork(id string) error
- func (a *NetworkAPI) DeletePort(id string) error
- func (a *NetworkAPI) DeleteSecurityGroup(id string) error
- func (a *NetworkAPI) DeleteSecurityGroupRule(id string) error
- func (a *NetworkAPI) DeleteSubnet(id string) error
- func (a *NetworkAPI) DetachPort(computeClient *Client, serverID, portID string) error
- func (a *NetworkAPI) GetSecurityGroup(id string) (*model.SecurityGroup, error)
- func (a *NetworkAPI) ListNetworks() ([]model.Network, error)
- func (a *NetworkAPI) ListPorts() ([]model.Port, error)
- func (a *NetworkAPI) ListPortsByDevice(deviceID string) ([]model.Port, error)
- func (a *NetworkAPI) ListQoSPolicies() ([]model.QoSPolicy, error)
- func (a *NetworkAPI) ListSecurityGroupRules() ([]model.SecurityGroupRule, error)
- func (a *NetworkAPI) ListSecurityGroups() ([]model.SecurityGroup, error)
- func (a *NetworkAPI) ListSubnets() ([]model.Subnet, error)
- func (a *NetworkAPI) UpdatePort(id string, body map[string]any) error
- func (a *NetworkAPI) UpdateSecurityGroup(id string, body map[string]any) error
- type ObjectStorageAPI
- func (a *ObjectStorageAPI) CreateContainer(name string) error
- func (a *ObjectStorageAPI) DeleteContainer(name string) error
- func (a *ObjectStorageAPI) DeleteObject(container, objectName string) error
- func (a *ObjectStorageAPI) DownloadObject(container, objectName, localPath string) error
- func (a *ObjectStorageAPI) GetAccountInfo() (*model.AccountInfo, error)
- func (a *ObjectStorageAPI) ListContainers() ([]model.Container, error)
- func (a *ObjectStorageAPI) ListObjects(container string) ([]model.StorageObject, error)
- func (a *ObjectStorageAPI) ListObjectsWithPrefix(container, prefix string) ([]model.StorageObject, error)
- func (a *ObjectStorageAPI) PublishContainer(name string) error
- func (a *ObjectStorageAPI) UnpublishContainer(name string) error
- func (a *ObjectStorageAPI) UploadObject(container, objectName, localPath string) error
- type TokenResult
- type VolumeAPI
- func (a *VolumeAPI) CreateVolume(req *model.VolumeCreateRequest) (*model.Volume, error)
- func (a *VolumeAPI) DeleteVolume(id string) error
- func (a *VolumeAPI) GetBackup(id string) (*model.Backup, error)
- func (a *VolumeAPI) GetVolume(id string) (*model.Volume, error)
- func (a *VolumeAPI) ListBackups() ([]model.Backup, error)
- func (a *VolumeAPI) ListVolumeTypes() ([]model.VolumeType, error)
- func (a *VolumeAPI) ListVolumes() ([]model.Volume, error)
- func (a *VolumeAPI) RestoreBackup(backupID, volumeID string) error
- func (a *VolumeAPI) UpdateVolume(id string, body map[string]any) error
Constants ¶
This section is empty.
Variables ¶
var UserAgent = "crowdy/conoha-cli/dev"
UserAgent is the User-Agent header value sent with all requests.
Functions ¶
func EnsureToken ¶
func EnsureToken(profile string, cfg *config.Config, creds *config.CredentialsStore, tokens *config.TokenStore) (string, error)
EnsureToken returns a valid token, refreshing if necessary. Priority: env var > cached token > re-authenticate.
func SetDebugLevel ¶ added in v0.1.3
func SetDebugLevel(level DebugLevel)
SetDebugLevel sets the debug level. Only increases (never decreases).
Types ¶
type AuthResponse ¶
type AuthResponse struct {
Token struct {
ExpiresAt string `json:"expires_at"`
} `json:"token"`
}
AuthResponse represents the token response from the Identity API.
type Client ¶
Client is the base HTTP client for ConoHa API.
func (*Client) BaseURL ¶
BaseURL returns the service endpoint URL. If CONOHA_ENDPOINT is set, it overrides the default URL. If CONOHA_ENDPOINT_MODE=int, the service name is appended as a path segment (with remapping for services that differ between ext and int APIs).
func (*Client) Do ¶
Do executes an HTTP request with auth headers and error handling. Note: retries only work for requests without a body (GET/DELETE). POST/PUT with a body are not retried because the body is consumed on first attempt.
type ComputeAPI ¶
type ComputeAPI struct {
Client *Client
}
ComputeAPI handles compute (server) operations.
func NewComputeAPI ¶
func NewComputeAPI(c *Client) *ComputeAPI
func (*ComputeAPI) AddSecurityGroup ¶ added in v0.5.0
func (a *ComputeAPI) AddSecurityGroup(id, name string) error
AddSecurityGroup adds a security group to a server.
func (*ComputeAPI) AttachVolume ¶
func (a *ComputeAPI) AttachVolume(serverID, volumeID string) error
AttachVolume attaches a volume to a server.
func (*ComputeAPI) CreateKeypair ¶
func (a *ComputeAPI) CreateKeypair(req *model.KeypairCreateRequest) (*model.Keypair, error)
CreateKeypair creates a new keypair.
func (*ComputeAPI) CreateServer ¶
func (a *ComputeAPI) CreateServer(req *model.ServerCreateRequest) (*model.Server, error)
CreateServer creates a new server.
func (*ComputeAPI) DeleteKeypair ¶
func (a *ComputeAPI) DeleteKeypair(name string) error
DeleteKeypair deletes a keypair.
func (*ComputeAPI) DeleteServer ¶
func (a *ComputeAPI) DeleteServer(id string) error
DeleteServer deletes a server.
func (*ComputeAPI) DetachVolume ¶
func (a *ComputeAPI) DetachVolume(serverID, volumeID string) error
DetachVolume detaches a volume from a server.
func (*ComputeAPI) FindServer ¶ added in v0.1.2
func (a *ComputeAPI) FindServer(idOrName string) (*model.Server, error)
FindServer finds a server by ID, name, or nametag. If idOrName looks like a UUID, it tries GetServer first. Otherwise, it lists all servers and matches by name, then by nametag.
func (*ComputeAPI) GetConsole ¶
func (a *ComputeAPI) GetConsole(id string) (*model.RemoteConsoleResponse, error)
GetConsole gets the VNC console URL via remote-consoles endpoint (Nova 2.6+).
func (*ComputeAPI) GetFlavor ¶
func (a *ComputeAPI) GetFlavor(id string) (*model.Flavor, error)
GetFlavor returns a flavor by ID.
func (*ComputeAPI) GetKeypair ¶ added in v0.4.2
func (a *ComputeAPI) GetKeypair(name string) (*model.Keypair, error)
GetKeypair returns a single keypair by name.
func (*ComputeAPI) GetServer ¶
func (a *ComputeAPI) GetServer(id string) (*model.Server, error)
GetServer returns a server by ID.
func (*ComputeAPI) GetServerMetadata ¶
func (a *ComputeAPI) GetServerMetadata(id string) (map[string]string, error)
GetServerMetadata returns server metadata.
func (*ComputeAPI) ListFlavors ¶
func (a *ComputeAPI) ListFlavors() ([]model.Flavor, error)
ListFlavors returns all flavors.
func (*ComputeAPI) ListKeypairs ¶
func (a *ComputeAPI) ListKeypairs() ([]model.Keypair, error)
ListKeypairs returns all keypairs.
func (*ComputeAPI) ListServers ¶
func (a *ComputeAPI) ListServers() ([]model.Server, error)
ListServers returns all servers.
func (*ComputeAPI) ListVolumeAttachments ¶ added in v0.3.3
func (a *ComputeAPI) ListVolumeAttachments(serverID string) ([]model.VolumeAttachment, error)
ListVolumeAttachments returns volumes attached to a server.
func (*ComputeAPI) RebootServer ¶
func (a *ComputeAPI) RebootServer(id string, hard bool) error
RebootServer reboots a server.
func (*ComputeAPI) RebuildServer ¶
func (a *ComputeAPI) RebuildServer(id, imageID string) error
RebuildServer rebuilds a server with a new image.
func (*ComputeAPI) RemoveSecurityGroup ¶ added in v0.5.0
func (a *ComputeAPI) RemoveSecurityGroup(id, name string) error
RemoveSecurityGroup removes a security group from a server.
func (*ComputeAPI) ResizeServer ¶
func (a *ComputeAPI) ResizeServer(id, flavorID string) error
ResizeServer resizes a server to a new flavor.
func (*ComputeAPI) ServerAction ¶
func (a *ComputeAPI) ServerAction(id string, action map[string]any) error
ServerAction performs an action on a server (start, stop, reboot, etc.).
func (*ComputeAPI) StartServer ¶
func (a *ComputeAPI) StartServer(id string) error
StartServer starts a stopped server.
func (*ComputeAPI) StopServer ¶
func (a *ComputeAPI) StopServer(id string) error
StopServer stops a running server.
func (*ComputeAPI) UpdateServerMetadata ¶ added in v0.4.2
func (a *ComputeAPI) UpdateServerMetadata(id string, meta map[string]string) (map[string]string, error)
UpdateServerMetadata merges metadata into a server's existing metadata.
type DNSAPI ¶
type DNSAPI struct {
Client *Client
}
func (*DNSAPI) CreateDomain ¶
func (*DNSAPI) CreateRecord ¶
func (*DNSAPI) DeleteDomain ¶
func (*DNSAPI) DeleteRecord ¶
type DebugLevel ¶ added in v0.1.3
type DebugLevel int
DebugLevel controls the verbosity of debug output.
const ( DebugOff DebugLevel = 0 DebugVerbose DebugLevel = 1 // method, URL, status, duration DebugAPI DebugLevel = 2 // + headers, bodies )
type IdentityAPI ¶
type IdentityAPI struct {
Client *Client
}
func NewIdentityAPI ¶
func NewIdentityAPI(c *Client) *IdentityAPI
func (*IdentityAPI) CreateCredential ¶
func (a *IdentityAPI) CreateCredential(credType, blob, userID string) (*model.Credential, error)
func (*IdentityAPI) CreateSubUser ¶
func (a *IdentityAPI) CreateSubUser(name, password string) (*model.SubUser, error)
func (*IdentityAPI) DeleteCredential ¶
func (a *IdentityAPI) DeleteCredential(id string) error
func (*IdentityAPI) DeleteSubUser ¶
func (a *IdentityAPI) DeleteSubUser(id string) error
func (*IdentityAPI) GetCredential ¶
func (a *IdentityAPI) GetCredential(id string) (*model.Credential, error)
func (*IdentityAPI) ListCredentials ¶
func (a *IdentityAPI) ListCredentials() ([]model.Credential, error)
func (*IdentityAPI) ListSubUsers ¶
func (a *IdentityAPI) ListSubUsers() ([]model.SubUser, error)
func (*IdentityAPI) UpdateSubUser ¶
func (a *IdentityAPI) UpdateSubUser(id string, body map[string]any) error
type ImageAPI ¶
type ImageAPI struct {
Client *Client
}
func NewImageAPI ¶
func (*ImageAPI) CreateImage ¶ added in v0.3.3
func (*ImageAPI) DeleteImage ¶
type LoadBalancerAPI ¶
type LoadBalancerAPI struct {
Client *Client
}
func NewLoadBalancerAPI ¶
func NewLoadBalancerAPI(c *Client) *LoadBalancerAPI
func (*LoadBalancerAPI) CreateHealthMonitor ¶
func (a *LoadBalancerAPI) CreateHealthMonitor(poolID, name, monitorType string, delay, timeout, maxRetries int, urlPath, expectedCodes string) (*model.HealthMonitor, error)
func (*LoadBalancerAPI) CreateListener ¶
func (*LoadBalancerAPI) CreateLoadBalancer ¶
func (a *LoadBalancerAPI) CreateLoadBalancer(name, subnetID string) (*model.LoadBalancer, error)
func (*LoadBalancerAPI) CreateMember ¶
func (*LoadBalancerAPI) CreatePool ¶
func (a *LoadBalancerAPI) CreatePool(name, protocol, lbAlgorithm, listenerID string) (*model.Pool, error)
func (*LoadBalancerAPI) DeleteHealthMonitor ¶
func (a *LoadBalancerAPI) DeleteHealthMonitor(id string) error
func (*LoadBalancerAPI) DeleteListener ¶
func (a *LoadBalancerAPI) DeleteListener(id string) error
func (*LoadBalancerAPI) DeleteLoadBalancer ¶
func (a *LoadBalancerAPI) DeleteLoadBalancer(id string) error
func (*LoadBalancerAPI) DeleteMember ¶
func (a *LoadBalancerAPI) DeleteMember(poolID, memberID string) error
func (*LoadBalancerAPI) DeletePool ¶
func (a *LoadBalancerAPI) DeletePool(id string) error
func (*LoadBalancerAPI) GetHealthMonitor ¶ added in v0.3.3
func (a *LoadBalancerAPI) GetHealthMonitor(id string) (*model.HealthMonitor, error)
func (*LoadBalancerAPI) GetListener ¶ added in v0.3.3
func (a *LoadBalancerAPI) GetListener(id string) (*model.Listener, error)
func (*LoadBalancerAPI) GetLoadBalancer ¶
func (a *LoadBalancerAPI) GetLoadBalancer(id string) (*model.LoadBalancer, error)
func (*LoadBalancerAPI) GetMember ¶ added in v0.3.3
func (a *LoadBalancerAPI) GetMember(poolID, memberID string) (*model.Member, error)
func (*LoadBalancerAPI) GetPool ¶ added in v0.3.3
func (a *LoadBalancerAPI) GetPool(id string) (*model.Pool, error)
func (*LoadBalancerAPI) ListHealthMonitors ¶
func (a *LoadBalancerAPI) ListHealthMonitors() ([]model.HealthMonitor, error)
func (*LoadBalancerAPI) ListListeners ¶
func (a *LoadBalancerAPI) ListListeners() ([]model.Listener, error)
func (*LoadBalancerAPI) ListLoadBalancers ¶
func (a *LoadBalancerAPI) ListLoadBalancers() ([]model.LoadBalancer, error)
func (*LoadBalancerAPI) ListMembers ¶
func (a *LoadBalancerAPI) ListMembers(poolID string) ([]model.Member, error)
func (*LoadBalancerAPI) UpdateLoadBalancer ¶
func (a *LoadBalancerAPI) UpdateLoadBalancer(id string, body map[string]any) error
type NetworkAPI ¶
type NetworkAPI struct {
Client *Client
}
func NewNetworkAPI ¶
func NewNetworkAPI(c *Client) *NetworkAPI
func (*NetworkAPI) AttachPort ¶
func (a *NetworkAPI) AttachPort(computeClient *Client, serverID, portID string) error
AttachPort attaches a port to a server (uses compute API).
func (*NetworkAPI) CreateNetwork ¶
func (a *NetworkAPI) CreateNetwork(name string) (*model.Network, error)
func (*NetworkAPI) CreatePort ¶
func (a *NetworkAPI) CreatePort(networkID, name string) (*model.Port, error)
func (*NetworkAPI) CreateSecurityGroup ¶
func (a *NetworkAPI) CreateSecurityGroup(name, description string) (*model.SecurityGroup, error)
func (*NetworkAPI) CreateSecurityGroupRule ¶
func (a *NetworkAPI) CreateSecurityGroupRule(sgID, direction, protocol, ethertype string, portMin, portMax *int, remoteIP string) (*model.SecurityGroupRule, error)
func (*NetworkAPI) CreateSubnet ¶
func (*NetworkAPI) DeleteNetwork ¶
func (a *NetworkAPI) DeleteNetwork(id string) error
func (*NetworkAPI) DeletePort ¶
func (a *NetworkAPI) DeletePort(id string) error
func (*NetworkAPI) DeleteSecurityGroup ¶
func (a *NetworkAPI) DeleteSecurityGroup(id string) error
func (*NetworkAPI) DeleteSecurityGroupRule ¶
func (a *NetworkAPI) DeleteSecurityGroupRule(id string) error
func (*NetworkAPI) DeleteSubnet ¶
func (a *NetworkAPI) DeleteSubnet(id string) error
func (*NetworkAPI) DetachPort ¶
func (a *NetworkAPI) DetachPort(computeClient *Client, serverID, portID string) error
DetachPort detaches a port from a server (uses compute API).
func (*NetworkAPI) GetSecurityGroup ¶
func (a *NetworkAPI) GetSecurityGroup(id string) (*model.SecurityGroup, error)
func (*NetworkAPI) ListNetworks ¶
func (a *NetworkAPI) ListNetworks() ([]model.Network, error)
func (*NetworkAPI) ListPortsByDevice ¶ added in v0.3.3
func (a *NetworkAPI) ListPortsByDevice(deviceID string) ([]model.Port, error)
ListPortsByDevice returns ports associated with a device (server).
func (*NetworkAPI) ListQoSPolicies ¶
func (a *NetworkAPI) ListQoSPolicies() ([]model.QoSPolicy, error)
func (*NetworkAPI) ListSecurityGroupRules ¶
func (a *NetworkAPI) ListSecurityGroupRules() ([]model.SecurityGroupRule, error)
func (*NetworkAPI) ListSecurityGroups ¶
func (a *NetworkAPI) ListSecurityGroups() ([]model.SecurityGroup, error)
func (*NetworkAPI) ListSubnets ¶
func (a *NetworkAPI) ListSubnets() ([]model.Subnet, error)
func (*NetworkAPI) UpdatePort ¶
func (a *NetworkAPI) UpdatePort(id string, body map[string]any) error
func (*NetworkAPI) UpdateSecurityGroup ¶
func (a *NetworkAPI) UpdateSecurityGroup(id string, body map[string]any) error
type ObjectStorageAPI ¶
type ObjectStorageAPI struct {
Client *Client
}
func NewObjectStorageAPI ¶
func NewObjectStorageAPI(c *Client) *ObjectStorageAPI
func (*ObjectStorageAPI) CreateContainer ¶
func (a *ObjectStorageAPI) CreateContainer(name string) error
func (*ObjectStorageAPI) DeleteContainer ¶
func (a *ObjectStorageAPI) DeleteContainer(name string) error
func (*ObjectStorageAPI) DeleteObject ¶
func (a *ObjectStorageAPI) DeleteObject(container, objectName string) error
func (*ObjectStorageAPI) DownloadObject ¶
func (a *ObjectStorageAPI) DownloadObject(container, objectName, localPath string) error
func (*ObjectStorageAPI) GetAccountInfo ¶
func (a *ObjectStorageAPI) GetAccountInfo() (*model.AccountInfo, error)
func (*ObjectStorageAPI) ListContainers ¶
func (a *ObjectStorageAPI) ListContainers() ([]model.Container, error)
func (*ObjectStorageAPI) ListObjects ¶
func (a *ObjectStorageAPI) ListObjects(container string) ([]model.StorageObject, error)
func (*ObjectStorageAPI) ListObjectsWithPrefix ¶ added in v0.3.3
func (a *ObjectStorageAPI) ListObjectsWithPrefix(container, prefix string) ([]model.StorageObject, error)
ListObjectsWithPrefix returns objects in a container filtered by prefix.
func (*ObjectStorageAPI) PublishContainer ¶
func (a *ObjectStorageAPI) PublishContainer(name string) error
func (*ObjectStorageAPI) UnpublishContainer ¶
func (a *ObjectStorageAPI) UnpublishContainer(name string) error
func (*ObjectStorageAPI) UploadObject ¶
func (a *ObjectStorageAPI) UploadObject(container, objectName, localPath string) error
type TokenResult ¶
TokenResult contains the token string and expiration.
func Authenticate ¶
func Authenticate(region, tenantID, username, password string) (*TokenResult, error)
Authenticate obtains a new token from the Identity API.
type VolumeAPI ¶
type VolumeAPI struct {
Client *Client
}
func NewVolumeAPI ¶
func (*VolumeAPI) CreateVolume ¶
func (*VolumeAPI) DeleteVolume ¶
func (*VolumeAPI) ListVolumeTypes ¶
func (a *VolumeAPI) ListVolumeTypes() ([]model.VolumeType, error)