Copyright | (c) 2025 |
---|---|
License | MIT |
Maintainer | |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Google.Cloud.Compute.Disk
Description
This module provides a Haskell client for Google Cloud Compute Engine Disk operations.
Synopsis
- listDisks :: String -> String -> Maybe ListDisksQuery -> IO (Either String DiskResponse)
- insertDisk :: String -> String -> InsertDiskOps -> Maybe InsertDiskQuery -> IO (Either String InsertDiskResponse)
- data DiskResponse = DiskResponse {}
- data InsertDiskOps = InsertDiskOps {
- name :: String
- sizeGb :: String
- description :: Maybe String
- type_ :: Maybe String
- sourceImage :: Maybe String
- sourceSnapshot :: Maybe String
- labels :: Maybe (Map String String)
- guestOsFeatures :: Maybe [GuestOsFeature]
- diskEncryptionKey :: Maybe EncryptionKey
- type InsertDiskResponse = Operation
- data Operation = Operation {
- id :: Maybe String
- name :: Maybe String
- zone :: Maybe String
- operationType :: Maybe String
- targetLink :: Maybe String
- status :: Maybe String
- progress :: Maybe Int
- insertTime :: Maybe String
- startTime :: Maybe String
- endTime :: Maybe String
- error :: Maybe OperationError
- warnings :: Maybe [Warning]
- selfLink :: Maybe String
- deleteDisk :: String -> String -> String -> Maybe DeleteDiskQuery -> IO (Either String Operation)
- createDiskSnapshot :: String -> String -> String -> CreateSnapshotOps -> Maybe CreateSnapshotQuery -> IO (Either String CreateSnapshotResp)
- type CreateSnapshotResp = Operation
- data CreateSnapshotOps = CreateSnapshotOps {
- name :: String
- description :: Maybe String
- labels :: Maybe (Map String String)
- storageLocations :: Maybe [String]
- snapshotEncryptionKey :: Maybe EncryptionKey
- data Warning = Warning {}
- data WarningData = WarningData {}
- defaultCreateSnapshotOps :: String -> CreateSnapshotOps
- defaultInsertOps :: String -> String -> InsertDiskOps
Documentation
Arguments
:: String | GCP Project ID |
-> String | Zone name |
-> Maybe ListDisksQuery | Optional query parameters |
-> IO (Either String DiskResponse) | List result or error} |
List disks in a zone
Example:
listDisks "my-project" "us-central1-a" Nothing
Arguments
:: String | GCP Project ID |
-> String | Zone name |
-> InsertDiskOps | Disk configuration |
-> Maybe InsertDiskQuery | Optional query parameters |
-> IO (Either String InsertDiskResponse) | Operation or error} |
Create a new persistent disk
Example:
insertDisk "my-project" "us-central1-a" (defaultInsertOps "disk1" "100") Nothing
data DiskResponse Source #
Response format for disk listing operations
Constructors
DiskResponse | |
Fields
|
Instances
FromJSON DiskResponse Source # | |
Defined in Google.Cloud.Compute.Disk | |
ToJSON DiskResponse Source # | |
Defined in Google.Cloud.Compute.Disk Methods toJSON :: DiskResponse -> Value # toEncoding :: DiskResponse -> Encoding # toJSONList :: [DiskResponse] -> Value # toEncodingList :: [DiskResponse] -> Encoding # omitField :: DiskResponse -> Bool # | |
Show DiskResponse Source # | |
Defined in Google.Cloud.Compute.Disk Methods showsPrec :: Int -> DiskResponse -> ShowS # show :: DiskResponse -> String # showList :: [DiskResponse] -> ShowS # | |
Eq DiskResponse Source # | |
Defined in Google.Cloud.Compute.Disk |
data InsertDiskOps Source #
Disk creation options
Constructors
InsertDiskOps | |
Fields
|
Instances
ToJSON InsertDiskOps Source # | |
Defined in Google.Cloud.Compute.Disk Methods toJSON :: InsertDiskOps -> Value # toEncoding :: InsertDiskOps -> Encoding # toJSONList :: [InsertDiskOps] -> Value # toEncodingList :: [InsertDiskOps] -> Encoding # omitField :: InsertDiskOps -> Bool # | |
Show InsertDiskOps Source # | |
Defined in Google.Cloud.Compute.Disk Methods showsPrec :: Int -> InsertDiskOps -> ShowS # show :: InsertDiskOps -> String # showList :: [InsertDiskOps] -> ShowS # | |
Eq InsertDiskOps Source # | |
Defined in Google.Cloud.Compute.Disk Methods (==) :: InsertDiskOps -> InsertDiskOps -> Bool # (/=) :: InsertDiskOps -> InsertDiskOps -> Bool # |
type InsertDiskResponse = Operation Source #
Alias for operation response from disk insertion
Long-running operation resource
Constructors
Operation | |
Fields
|
Arguments
:: String | GCP Project ID |
-> String | Zone name |
-> String | Disk name to delete |
-> Maybe DeleteDiskQuery | Optional force deletion |
-> IO (Either String Operation) | Operation or error |
Deletes a disk with optional query parameters
Delete a persistent disk
Example:
deleteDisk "my-project" "us-central1-a" "old-disk" (Just DeleteDiskQuery { force = True })
Arguments
:: String | GCP Project ID |
-> String | Zone name |
-> String | Source disk name |
-> CreateSnapshotOps | Snapshot configuration |
-> Maybe CreateSnapshotQuery | Optional guest flush |
-> IO (Either String CreateSnapshotResp) | Operation or error |
Creates a snapshot of a disk with optional query parameters | Create disk snapshot
Example:
createDiskSnapshot "my-project" "us-central1-a" "source-disk" (defaultCreateSnapshotOps "daily-backup") Nothing
type CreateSnapshotResp = Operation Source #
Alias for operation response from snapshot creation
data CreateSnapshotOps Source #
Snapshot creation options
Constructors
CreateSnapshotOps | |
Fields
|
Instances
ToJSON CreateSnapshotOps Source # | |
Defined in Google.Cloud.Compute.Disk Methods toJSON :: CreateSnapshotOps -> Value # toEncoding :: CreateSnapshotOps -> Encoding # toJSONList :: [CreateSnapshotOps] -> Value # toEncodingList :: [CreateSnapshotOps] -> Encoding # omitField :: CreateSnapshotOps -> Bool # | |
Show CreateSnapshotOps Source # | |
Defined in Google.Cloud.Compute.Disk Methods showsPrec :: Int -> CreateSnapshotOps -> ShowS # show :: CreateSnapshotOps -> String # showList :: [CreateSnapshotOps] -> ShowS # | |
Eq CreateSnapshotOps Source # | |
Defined in Google.Cloud.Compute.Disk Methods (==) :: CreateSnapshotOps -> CreateSnapshotOps -> Bool # (/=) :: CreateSnapshotOps -> CreateSnapshotOps -> Bool # |
Represents a warning object returned by Google Cloud API operations
Constructors
Warning | |
data WarningData Source #
Key-value pair providing additional context for warnings
Constructors
WarningData | |
Instances
FromJSON WarningData Source # | |
Defined in Google.Cloud.Compute.Disk | |
ToJSON WarningData Source # | |
Defined in Google.Cloud.Compute.Disk Methods toJSON :: WarningData -> Value # toEncoding :: WarningData -> Encoding # toJSONList :: [WarningData] -> Value # toEncodingList :: [WarningData] -> Encoding # omitField :: WarningData -> Bool # | |
Show WarningData Source # | |
Defined in Google.Cloud.Compute.Disk Methods showsPrec :: Int -> WarningData -> ShowS # show :: WarningData -> String # showList :: [WarningData] -> ShowS # | |
Eq WarningData Source # | |
Defined in Google.Cloud.Compute.Disk |
defaultCreateSnapshotOps :: String -> CreateSnapshotOps Source #
Default snapshot creation options
Creates minimal valid configuration with required snapshot name. Additional fields can be added using record update syntax:
defaultCreateSnapshotOps "backup" { description = Just "Daily backup" }
defaultInsertOps :: String -> String -> InsertDiskOps Source #
Default disk creation options
Creates minimal valid configuration with required name and size. Other fields can be added using record update syntax:
defaultInsertOps "new-disk" "50" { type_ = Just "pd-ssd" }