|
| 1 | +package upcloud |
| 2 | + |
| 3 | +import ( |
| 4 | + "time" |
| 5 | +) |
| 6 | + |
| 7 | +const ( |
| 8 | + // ManagedObjectStorageConfiguredStatusStarted indicates that service is running |
| 9 | + ManagedObjectStorageConfiguredStatusStarted ManagedObjectStorageConfiguredStatus = "started" |
| 10 | + // ManagedObjectStorageConfiguredStatusStopped indicates that service is stopped |
| 11 | + ManagedObjectStorageConfiguredStatusStopped ManagedObjectStorageConfiguredStatus = "stopped" |
| 12 | +) |
| 13 | + |
| 14 | +const ( |
| 15 | + // ManagedObjectStorageOperationalStateDeleteDNS indicates that DNS records are being removed |
| 16 | + ManagedObjectStorageOperationalStateDeleteDNS ManagedObjectStorageOperationalState = "delete-dns" |
| 17 | + // ManagedObjectStorageOperationalStateDeleteNetwork indicates that network is being reconfigured |
| 18 | + ManagedObjectStorageOperationalStateDeleteNetwork ManagedObjectStorageOperationalState = "delete-network" |
| 19 | + // ManagedObjectStorageOperationalStateDeleteService indicates that service is being deleted |
| 20 | + ManagedObjectStorageOperationalStateDeleteService ManagedObjectStorageOperationalState = "delete-service" |
| 21 | + // ManagedObjectStorageOperationalStateDeleteUser indicates that users are being deleted |
| 22 | + ManagedObjectStorageOperationalStateDeleteUser ManagedObjectStorageOperationalState = "delete-user" |
| 23 | + // ManagedObjectStorageOperationalStatePending indicates newly created service or that started reconfiguration |
| 24 | + ManagedObjectStorageOperationalStatePending ManagedObjectStorageOperationalState = "started" |
| 25 | + // ManagedObjectStorageOperationalStateRunning indicates that service is up and running |
| 26 | + ManagedObjectStorageOperationalStateRunning ManagedObjectStorageOperationalState = "running" |
| 27 | + // ManagedObjectStorageOperationalStateSetupCheckup indicates that service configuration and state are being verified |
| 28 | + ManagedObjectStorageOperationalStateSetupCheckup ManagedObjectStorageOperationalState = "setup-checkup" |
| 29 | + // ManagedObjectStorageOperationalStateSetupDNS indicates that DNS records are being updated |
| 30 | + ManagedObjectStorageOperationalStateSetupDNS ManagedObjectStorageOperationalState = "setup-dns" |
| 31 | + // ManagedObjectStorageOperationalStateSetupNetwork indicates that network is being configured |
| 32 | + ManagedObjectStorageOperationalStateSetupNetwork ManagedObjectStorageOperationalState = "setup-network" |
| 33 | + // ManagedObjectStorageOperationalStateSetupService indicates that service is being configured |
| 34 | + ManagedObjectStorageOperationalStateSetupService ManagedObjectStorageOperationalState = "setup-service" |
| 35 | + // ManagedObjectStorageOperationalStateSetupUser indicates that users are being configured |
| 36 | + ManagedObjectStorageOperationalStateSetupUser ManagedObjectStorageOperationalState = "setup-user" |
| 37 | + // ManagedObjectStorageOperationalStateStopped indicates that service is down |
| 38 | + ManagedObjectStorageOperationalStateStopped ManagedObjectStorageOperationalState = "stopped" |
| 39 | +) |
| 40 | + |
| 41 | +const ( |
| 42 | + // ManagedObjectStorageUserOperationalStatePending indicates a newly attached user |
| 43 | + ManagedObjectStorageUserOperationalStatePending ManagedObjectStorageUserOperationalState = "pending" |
| 44 | + // ManagedObjectStorageUserOperationalStateReady indicates that the user is configured and ready for access keys issuing |
| 45 | + ManagedObjectStorageUserOperationalStateReady ManagedObjectStorageUserOperationalState = "ready" |
| 46 | +) |
| 47 | + |
| 48 | +type ( |
| 49 | + // ManagedObjectStorageConfiguredStatus indicates the service's current intended status. Managed by the customer |
| 50 | + ManagedObjectStorageConfiguredStatus string |
| 51 | + // ManagedObjectStorageOperationalState indicates the service's current operational, effective state. Managed by the system |
| 52 | + ManagedObjectStorageOperationalState string |
| 53 | + // ManagedObjectStorageUserOperationalState indicates the user's current operational, effective state. Managed by the system |
| 54 | + ManagedObjectStorageUserOperationalState string |
| 55 | +) |
| 56 | + |
| 57 | +// ManagedObjectStorage represents a Managed Object Storage service |
| 58 | +type ManagedObjectStorage struct { |
| 59 | + ConfiguredStatus ManagedObjectStorageConfiguredStatus `json:"configured_status"` |
| 60 | + CreatedAt time.Time `json:"created_at"` |
| 61 | + Endpoints []ManagedObjectStorageEndpoint `json:"endpoints"` |
| 62 | + Labels []Label `json:"labels"` |
| 63 | + Networks []ManagedObjectStorageNetwork `json:"networks"` |
| 64 | + OperationalState ManagedObjectStorageOperationalState `json:"operational_state"` |
| 65 | + Region string `json:"region"` |
| 66 | + UpdatedAt time.Time `json:"updated_at"` |
| 67 | + Users []ManagedObjectStorageUser `json:"users"` |
| 68 | + UUID string `json:"uuid"` |
| 69 | +} |
| 70 | + |
| 71 | +// ManagedObjectStorageEndpoint represents an endpoint for accessing the Managed Object Storage service |
| 72 | +type ManagedObjectStorageEndpoint struct { |
| 73 | + DomainName string `json:"domain_name"` |
| 74 | + Type string `json:"type"` |
| 75 | +} |
| 76 | + |
| 77 | +// ManagedObjectStorageNetwork represents a network from where object storage can be used. Private networks must reside in object storage region |
| 78 | +type ManagedObjectStorageNetwork struct { |
| 79 | + Family string `json:"family"` |
| 80 | + Name string `json:"name"` |
| 81 | + Type string `json:"type"` |
| 82 | + UUID *string `json:"uuid,omitempty"` |
| 83 | +} |
| 84 | + |
| 85 | +// ManagedObjectStorageUser represents a user for the Managed Object Storage service |
| 86 | +type ManagedObjectStorageUser struct { |
| 87 | + AccessKeys []ManagedObjectStorageUserAccessKey `json:"access_keys"` |
| 88 | + CreatedAt time.Time `json:"created_at"` |
| 89 | + OperationalState ManagedObjectStorageUserOperationalState `json:"operational_state"` |
| 90 | + UpdatedAt time.Time `json:"updated_at"` |
| 91 | + Username string `json:"username"` |
| 92 | +} |
| 93 | + |
| 94 | +// ManagedObjectStorageRegion represents a region where Managed Object Storage service can be hosted |
| 95 | +type ManagedObjectStorageRegion struct { |
| 96 | + Name string `json:"name"` |
| 97 | + PrimaryZone string `json:"primary_zone"` |
| 98 | + Zones []ManagedObjectStorageRegionZone `json:"zones"` |
| 99 | +} |
| 100 | + |
| 101 | +// ManagedObjectStorageRegionZone represents a zone within the Managed Object Storage service region |
| 102 | +type ManagedObjectStorageRegionZone struct { |
| 103 | + Name string `json:"name"` |
| 104 | +} |
| 105 | + |
| 106 | +// ManagedObjectStorageUserAccessKey represents Access Key details for a Managed Object Storage service user |
| 107 | +type ManagedObjectStorageUserAccessKey struct { |
| 108 | + AccessKeyId string `json:"access_key_id"` |
| 109 | + CreatedAt time.Time `json:"created_at"` |
| 110 | + Enabled bool `json:"enabled"` |
| 111 | + LastUsedAt time.Time `json:"last_used_at"` |
| 112 | + Name string `json:"name"` |
| 113 | + SecretAccessKey *string `json:"secret_access_key,omitempty"` |
| 114 | + UpdatedAt time.Time `json:"updated_at"` |
| 115 | +} |
| 116 | + |
| 117 | +// ManagedObjectStorageBucketMetrics represents metrics for a Managed Object Storage service bucket |
| 118 | +type ManagedObjectStorageBucketMetrics struct { |
| 119 | + Name string `json:"name"` |
| 120 | + TotalObjects int `json:"total_objects"` |
| 121 | + TotalSizeBytes int `json:"total_size_bytes"` |
| 122 | +} |
| 123 | + |
| 124 | +// ManagedObjectStorageMetrics represents metrics for a Managed Object Storage service |
| 125 | +type ManagedObjectStorageMetrics struct { |
| 126 | + TotalObjects int `json:"total_objects"` |
| 127 | + TotalSizeBytes int `json:"total_size_bytes"` |
| 128 | +} |
0 commit comments