Documentation
¶
Overview ¶
Package resources contains one file per STACKIT resource type that stackit-nuke knows how to discover and delete. Each file registers a libnuke registration during init() and exposes a Lister that returns resources observed in the supplied project + region.
The Lister bodies are placeholders — they return an empty slice so the framework wires up correctly end-to-end. Filling them in with real STACKIT SDK calls is the per-resource implementation work.
Index ¶
- Constants
- func PropsFromStruct(v any) types.Properties
- type BaseResource
- type ComputeKeypair
- type ComputeKeypairLister
- type ComputeServer
- type ComputeServerLister
- type ComputeSnapshot
- type ComputeSnapshotLister
- type ComputeVolume
- type ComputeVolumeLister
- type DNSZone
- type DNSZoneLister
- type FloatingIP
- type FloatingIPLister
- type GitInstance
- type GitInstanceLister
- type LoadBalancer
- type LoadBalancerLister
- type MariaDBInstance
- type MariaDBInstanceLister
- type MongoDBFlexInstance
- type MongoDBFlexInstanceLister
- type Network
- type NetworkInterface
- type NetworkInterfaceLister
- type NetworkLister
- type ObjectStorageBucket
- type ObjectStorageBucketLister
- type OpenSearchInstance
- type OpenSearchInstanceLister
- type PostgresFlexInstance
- type PostgresFlexInstanceLister
- type RabbitMQInstance
- type RabbitMQInstanceLister
- type RedisInstance
- type RedisInstanceLister
- type SKECluster
- type SKEClusterLister
- type SecurityGroup
- type SecurityGroupLister
Constants ¶
const ComputeKeypairResource = "ComputeKeypair"
const ComputeServerResource = "ComputeServer"
const ComputeSnapshotResource = "ComputeSnapshot"
const ComputeVolumeResource = "ComputeVolume"
const DNSZoneResource = "DNSZone"
const FloatingIPResource = "FloatingIP"
const GitInstanceResource = "GitInstance"
const LoadBalancerResource = "LoadBalancer"
const MariaDBInstanceResource = "MariaDBInstance"
const MongoDBFlexInstanceResource = "MongoDBFlexInstance"
const NetworkInterfaceResource = "NetworkInterface"
const NetworkResource = "Network"
const ObjectStorageBucketResource = "ObjectStorageBucket"
const OpenSearchInstanceResource = "OpenSearchInstance"
const PostgresFlexInstanceResource = "PostgresFlexInstance"
const RabbitMQInstanceResource = "RabbitMQInstance"
const RedisInstanceResource = "RedisInstance"
const SKEClusterResource = "SKECluster"
const SecurityGroupResource = "SecurityGroup"
Variables ¶
This section is empty.
Functions ¶
func PropsFromStruct ¶
func PropsFromStruct(v any) types.Properties
PropsFromStruct is a small helper so resource Properties() bodies stay one-liners.
Types ¶
type BaseResource ¶
type BaseResource struct {
OrganizationID string `property:"OrganizationID"`
ProjectID string `property:"ProjectID"`
Region string `property:"Region"`
}
BaseResource embeds the project + region context every STACKIT resource shares. Use struct embedding with `property:",inline"` so the fields participate in libnuke's filter/property system.
type ComputeKeypair ¶
type ComputeKeypair struct {
*BaseResource `property:",inline"`
Name string
Fingerprint string
CreatedAt *time.Time
Labels map[string]string
// contains filtered or unexported fields
}
ComputeKeypair is a STACKIT IaaS SSH keypair.
API: github.com/stackitcloud/stackit-sdk-go/services/iaas/v2api
Endpoints used:
- GET /v2/keypairs
- DELETE /v2/keypairs/{keypairName}
Keypairs are neither regional nor project-scoped: they belong to the authenticated identity (user or service account). Listers run once per (project, region); the Lister only returns keypairs during the first configured project's first region scan, so each keypair shows up exactly once per run.
func (*ComputeKeypair) Properties ¶
func (r *ComputeKeypair) Properties() types.Properties
func (*ComputeKeypair) String ¶
func (r *ComputeKeypair) String() string
type ComputeKeypairLister ¶
type ComputeKeypairLister struct{}
type ComputeServer ¶
type ComputeServer struct {
*BaseResource `property:",inline"`
ID string
Name string
AvailabilityZone string
CreatedAt *time.Time
Labels map[string]string
// contains filtered or unexported fields
}
ComputeServer is a STACKIT IaaS server (a.k.a. virtual machine).
API: github.com/stackitcloud/stackit-sdk-go/services/iaas/v2api
Endpoints used:
- GET /v2/projects/{projectId}/regions/{region}/servers
- DELETE /v2/projects/{projectId}/regions/{region}/servers/{serverId}
func (*ComputeServer) Properties ¶
func (r *ComputeServer) Properties() types.Properties
func (*ComputeServer) String ¶
func (r *ComputeServer) String() string
type ComputeServerLister ¶
type ComputeServerLister struct{}
type ComputeSnapshot ¶
type ComputeSnapshot struct {
*BaseResource `property:",inline"`
ID string
Name string
VolumeID string
SizeGB int64
Status string
CreatedAt *time.Time
Labels map[string]string
// contains filtered or unexported fields
}
ComputeSnapshot is a STACKIT IaaS volume snapshot.
API: github.com/stackitcloud/stackit-sdk-go/services/iaas/v2api
Endpoints used:
- GET /v2/projects/{projectId}/regions/{region}/snapshots
- DELETE /v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}
Deletion is asynchronous: the snapshot stays listed with status DELETING until it is gone, which is exactly the wait behavior libnuke expects. Remove skips the DELETE call for snapshots already in that state, and the Lister drops snapshots with status DELETED so a finished delete can never keep libnuke waiting.
func (*ComputeSnapshot) Properties ¶
func (r *ComputeSnapshot) Properties() types.Properties
func (*ComputeSnapshot) String ¶
func (r *ComputeSnapshot) String() string
type ComputeSnapshotLister ¶
type ComputeSnapshotLister struct{}
type ComputeVolume ¶
type ComputeVolume struct {
*BaseResource `property:",inline"`
ID string
Name string
AvailabilityZone string
SizeGB int64
Bootable bool
Status string
ServerID string
CreatedAt *time.Time
Labels map[string]string
// contains filtered or unexported fields
}
ComputeVolume is a STACKIT IaaS block volume.
API: github.com/stackitcloud/stackit-sdk-go/services/iaas/v2api
Endpoints used:
- GET /v2/projects/{projectId}/regions/{region}/volumes
- DELETE /v2/projects/{projectId}/regions/{region}/volumes/{volumeId}
func (*ComputeVolume) Properties ¶
func (r *ComputeVolume) Properties() types.Properties
func (*ComputeVolume) String ¶
func (r *ComputeVolume) String() string
type ComputeVolumeLister ¶
type ComputeVolumeLister struct{}
type DNSZone ¶
type DNSZone struct {
*BaseResource `property:",inline"`
ID string
Name string
DNSName string
State string
// contains filtered or unexported fields
}
DNSZone is a STACKIT DNS zone.
API: github.com/stackitcloud/stackit-sdk-go/services/dns/v1api
Endpoints used:
- GET /v1/projects/{projectId}/zones
- DELETE /v1/projects/{projectId}/zones/{zoneId}
DNS is a global service: zones are not bound to a region, but listers run once per (project, region). The Lister therefore only returns zones for the first configured region, so each zone shows up exactly once per run.
Deleting a zone is a soft delete: the zone stays listed with state DELETE_SUCCEEDED during the retention window. The Lister skips those, so libnuke sees the zone as gone once the delete has landed.
func (*DNSZone) Properties ¶
func (r *DNSZone) Properties() types.Properties
type DNSZoneLister ¶
type DNSZoneLister struct{}
type FloatingIP ¶
type FloatingIP struct {
*BaseResource `property:",inline"`
ID string
IP string
NetworkInterface string
Labels map[string]string
// contains filtered or unexported fields
}
FloatingIP is a STACKIT IaaS public IP.
API: github.com/stackitcloud/stackit-sdk-go/services/iaas/v2api
Endpoints used:
- GET /v2/projects/{projectId}/regions/{region}/public-ips
- DELETE /v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}
func (*FloatingIP) Properties ¶
func (r *FloatingIP) Properties() types.Properties
func (*FloatingIP) String ¶
func (r *FloatingIP) String() string
type FloatingIPLister ¶
type FloatingIPLister struct{}
type GitInstance ¶ added in v0.0.7
type GitInstance struct {
*BaseResource `property:",inline"`
ID string
Name string
URL string
Flavor string
Version string
State string
// contains filtered or unexported fields
}
GitInstance is a STACKIT Git instance.
API: github.com/stackitcloud/stackit-sdk-go/services/git/v1betaapi
Endpoints used:
- GET /v1beta/projects/{projectId}/instances
- DELETE /v1beta/projects/{projectId}/instances/{instanceId}
STACKIT Git is a global service: instances are not bound to a region (the API host's region variable defaults to "global" and no endpoint takes a region), but listers run once per (project, region). The Lister therefore only returns instances for the first configured region, so each instance shows up exactly once per run.
Deletion is asynchronous: the instance stays listed in state "Deleting" until it is gone, which is exactly the wait behavior libnuke expects.
func (*GitInstance) Properties ¶ added in v0.0.7
func (r *GitInstance) Properties() types.Properties
func (*GitInstance) Remove ¶ added in v0.0.7
func (r *GitInstance) Remove(ctx context.Context) error
func (*GitInstance) String ¶ added in v0.0.7
func (r *GitInstance) String() string
type GitInstanceLister ¶ added in v0.0.7
type GitInstanceLister struct{}
type LoadBalancer ¶
type LoadBalancer struct {
*BaseResource `property:",inline"`
Name string
}
func (*LoadBalancer) Properties ¶
func (r *LoadBalancer) Properties() types.Properties
func (*LoadBalancer) String ¶
func (r *LoadBalancer) String() string
type LoadBalancerLister ¶
type LoadBalancerLister struct{}
type MariaDBInstance ¶ added in v0.0.8
type MariaDBInstance struct {
*BaseResource `property:",inline"`
ID string
Name string
Plan string
Version string
Status string
// contains filtered or unexported fields
}
MariaDBInstance is a STACKIT MariaDB instance.
API: github.com/stackitcloud/stackit-sdk-go/services/mariadb/v2api
Endpoints used:
- GET /v2/projects/{projectId}/regions/{regionId}/instances
- DELETE /v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}
Deletion is asynchronous: the instance stays listed with status "deleting" until it is gone, which is exactly the wait behavior libnuke expects. Remove skips the DELETE call for instances already in that state (e.g. left over from an interrupted run). The Lister drops instances whose last operation is a succeeded delete, so a finished delete can never keep libnuke waiting.
func (*MariaDBInstance) Properties ¶ added in v0.0.8
func (r *MariaDBInstance) Properties() types.Properties
func (*MariaDBInstance) Remove ¶ added in v0.0.8
func (r *MariaDBInstance) Remove(ctx context.Context) error
func (*MariaDBInstance) String ¶ added in v0.0.8
func (r *MariaDBInstance) String() string
type MariaDBInstanceLister ¶ added in v0.0.8
type MariaDBInstanceLister struct{}
type MongoDBFlexInstance ¶
type MongoDBFlexInstance struct {
*BaseResource `property:",inline"`
ID string
Name string
}
func (*MongoDBFlexInstance) Properties ¶
func (r *MongoDBFlexInstance) Properties() types.Properties
func (*MongoDBFlexInstance) String ¶
func (r *MongoDBFlexInstance) String() string
type MongoDBFlexInstanceLister ¶
type MongoDBFlexInstanceLister struct{}
type Network ¶
type Network struct {
*BaseResource `property:",inline"`
ID string
Name string
Routed bool
Status string
CreatedAt *time.Time
Labels map[string]string
// contains filtered or unexported fields
}
Network is a STACKIT IaaS network.
API: github.com/stackitcloud/stackit-sdk-go/services/iaas/v2api
Endpoints used:
- GET /v2/projects/{projectId}/regions/{region}/networks
- DELETE /v2/projects/{projectId}/regions/{region}/networks/{networkId}
func (*Network) Properties ¶
func (r *Network) Properties() types.Properties
type NetworkInterface ¶ added in v0.0.2
type NetworkInterface struct {
*BaseResource `property:",inline"`
ID string
Name string
NetworkID string
Device string
IPv4 string
MAC string
Status string
Labels map[string]string
// contains filtered or unexported fields
}
NetworkInterface is a STACKIT IaaS NIC. NICs live under a Network, so the API path includes both networkId and nicId.
API: github.com/stackitcloud/stackit-sdk-go/services/iaas/v2api
Endpoints used:
- GET /v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics
- DELETE /v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}
func (*NetworkInterface) Properties ¶ added in v0.0.2
func (r *NetworkInterface) Properties() types.Properties
func (*NetworkInterface) Remove ¶ added in v0.0.2
func (r *NetworkInterface) Remove(ctx context.Context) error
func (*NetworkInterface) String ¶ added in v0.0.2
func (r *NetworkInterface) String() string
type NetworkInterfaceLister ¶ added in v0.0.2
type NetworkInterfaceLister struct{}
type NetworkLister ¶
type NetworkLister struct{}
type ObjectStorageBucket ¶
type ObjectStorageBucket struct {
*BaseResource `property:",inline"`
Name string
ObjectLockEnabled bool
URL string
// contains filtered or unexported fields
}
ObjectStorageBucket is a STACKIT Object Storage bucket.
API: github.com/stackitcloud/stackit-sdk-go/services/objectstorage/v2api
Endpoints used:
- GET /v2/project/{projectId}/regions/{region}/buckets
- DELETE /v2/project/{projectId}/regions/{region}/bucket/{bucketName}
- POST /v2/project/{projectId}/regions/{region}/credentials-group
- DELETE /v2/project/{projectId}/regions/{region}/credentials-group/{groupId}
- POST /v2/project/{projectId}/regions/{region}/access-key
- DELETE /v2/project/{projectId}/regions/{region}/access-key/{keyId}
- S3 ListObjectVersions + DeleteObjects on the bucket
The API refuses to delete a bucket that still holds objects (422 bucket.not_empty), and it has no object endpoints. On that error Remove creates a temporary credentials group + access key, deletes every object version and delete marker over S3, deletes the bucket, and then removes the temporary credentials again. Objects are therefore not a separate resource type.
Projects without Object Storage enabled answer the list call with 404, which the Lister treats as "no buckets".
func (*ObjectStorageBucket) Properties ¶
func (r *ObjectStorageBucket) Properties() types.Properties
func (*ObjectStorageBucket) Remove ¶
func (r *ObjectStorageBucket) Remove(ctx context.Context) error
func (*ObjectStorageBucket) String ¶
func (r *ObjectStorageBucket) String() string
type ObjectStorageBucketLister ¶
type ObjectStorageBucketLister struct{}
type OpenSearchInstance ¶
type OpenSearchInstance struct {
*BaseResource `property:",inline"`
ID string
Name string
}
func (*OpenSearchInstance) Properties ¶
func (r *OpenSearchInstance) Properties() types.Properties
func (*OpenSearchInstance) String ¶
func (r *OpenSearchInstance) String() string
type OpenSearchInstanceLister ¶
type OpenSearchInstanceLister struct{}
type PostgresFlexInstance ¶
type PostgresFlexInstance struct {
*BaseResource `property:",inline"`
ID string
Name string
Status string
// contains filtered or unexported fields
}
PostgresFlexInstance is a STACKIT PostgreSQL Flex instance.
API: github.com/stackitcloud/stackit-sdk-go/services/postgresflex/v2api
Endpoints used:
- GET /v2/projects/{projectId}/regions/{region}/instances
- GET /v2/projects/{projectId}/regions/{region}/instances/{instanceId}
- DELETE /v2/projects/{projectId}/regions/{region}/instances/{instanceId}
- DELETE /v2/projects/{projectId}/regions/{region}/instances/{instanceId}/force
Deleting an instance is a soft delete: it stays listed with status "Deleted" during the retention window, so libnuke would wait on it forever (Remove is only invoked once per item per run). Remove therefore soft-deletes, polls until the instance reaches "Deleted", then force-deletes to purge it within the same run.
func (*PostgresFlexInstance) Properties ¶
func (r *PostgresFlexInstance) Properties() types.Properties
func (*PostgresFlexInstance) Remove ¶
func (r *PostgresFlexInstance) Remove(ctx context.Context) error
func (*PostgresFlexInstance) String ¶
func (r *PostgresFlexInstance) String() string
type PostgresFlexInstanceLister ¶
type PostgresFlexInstanceLister struct{}
type RabbitMQInstance ¶
type RabbitMQInstance struct {
*BaseResource `property:",inline"`
ID string
Name string
}
func (*RabbitMQInstance) Properties ¶
func (r *RabbitMQInstance) Properties() types.Properties
func (*RabbitMQInstance) String ¶
func (r *RabbitMQInstance) String() string
type RabbitMQInstanceLister ¶
type RabbitMQInstanceLister struct{}
type RedisInstance ¶
type RedisInstance struct {
*BaseResource `property:",inline"`
ID string
Name string
}
func (*RedisInstance) Properties ¶
func (r *RedisInstance) Properties() types.Properties
func (*RedisInstance) String ¶
func (r *RedisInstance) String() string
type RedisInstanceLister ¶
type RedisInstanceLister struct{}
type SKECluster ¶
type SKECluster struct {
*BaseResource `property:",inline"`
Name string
}
func (*SKECluster) Properties ¶
func (r *SKECluster) Properties() types.Properties
func (*SKECluster) String ¶
func (r *SKECluster) String() string
type SKEClusterLister ¶
type SKEClusterLister struct{}
type SecurityGroup ¶
type SecurityGroup struct {
*BaseResource `property:",inline"`
ID string
Name string
Description string
Stateful bool
CreatedAt *time.Time
Labels map[string]string
// contains filtered or unexported fields
}
SecurityGroup is a STACKIT IaaS security group.
Note: STACKIT auto-creates a "default" SG per project. It is generally protected and will fail to delete; filter it out in config via `filters.SecurityGroup: [{property: Name, value: default}]`.
API: github.com/stackitcloud/stackit-sdk-go/services/iaas/v2api
Endpoints used:
- GET /v2/projects/{projectId}/regions/{region}/security-groups
- DELETE /v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}
func (*SecurityGroup) Properties ¶
func (r *SecurityGroup) Properties() types.Properties
func (*SecurityGroup) String ¶
func (r *SecurityGroup) String() string
Source Files
¶
- base.go
- compute-keypair.go
- compute-server.go
- compute-snapshot.go
- compute-volume.go
- dns-zone.go
- git-instance.go
- loadbalancer.go
- mariadb-instance.go
- mongodbflex-instance.go
- network-floatingip.go
- network-network.go
- network-nic.go
- network-securitygroup.go
- objectstorage-bucket.go
- opensearch-instance.go
- postgresflex-instance.go
- rabbitmq-instance.go
- redis-instance.go
- sdk_helpers.go
- ske-cluster.go