Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion api/audit_trail/v1alpha1/audit_trail_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,47 @@ var (
_ = namegenerator.GetRandomName
)

type Action string

const (
ActionUnknownAction = Action("unknown_action")
ActionCreate = Action("create")
ActionUpdate = Action("update")
ActionDelete = Action("delete")
)

func (enum Action) String() string {
if enum == "" {
// return default value if empty
return string(ActionUnknownAction)
}
return string(enum)
}

func (enum Action) Values() []Action {
return []Action{
"unknown_action",
"create",
"update",
"delete",
}
}

func (enum Action) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}

func (enum *Action) UnmarshalJSON(data []byte) error {
tmp := ""

if err := json.Unmarshal(data, &tmp); err != nil {
return err
}

*enum = Action(Action(tmp).String())
return nil
}

type AlertRuleStatus string

const (
Expand Down Expand Up @@ -1330,7 +1371,8 @@ type Resource struct {

Name *string `json:"name"`

Action *string `json:"action"`
// Action: default value: unknown_action
Action *Action `json:"action"`

// Deprecated
// Precisely one of SecmSecretInfo, SecmSecretVersionInfo, KubeClusterInfo, KubePoolInfo, KubeNodeInfo, KubeACLInfo, KeymKeyInfo, SecretManagerSecretInfo, SecretManagerVersionInfo, KeyManagerKeyInfo, AccountUserInfo, AccountOrganizationInfo, InstanceServerInfo, AppleSiliconServerInfo, AccountProjectInfo, BaremetalServerInfo, BaremetalSettingInfo, IpamIPInfo, LoadBalancerLBInfo, LoadBalancerIPInfo, LoadBalancerFrontendInfo, LoadBalancerBackendInfo, LoadBalancerRouteInfo, LoadBalancerACLInfo, LoadBalancerCertificateInfo, EdgeServicesPlanInfo, EdgeServicesPipelineInfo, EdgeServicesDNSStageInfo, EdgeServicesTLSStageInfo, EdgeServicesCacheStageInfo, EdgeServicesRouteStageInfo, EdgeServicesRouteRulesInfo, EdgeServicesWafStageInfo, EdgeServicesBackendStageInfo, AccountContractSignatureInfo, VpcSubnetInfo, VpcRouteInfo, VpcPrivateNetworkInfo, AuditTrailExportJobInfo, VpcGwGatewayInfo, VpcGwGatewayNetworkInfo, AppleSiliconRunnerInfo, AuditTrailAlertRuleInfo, VpcConnectorInfo, InstancePrivateNetworkInterfaceInfo, VpcIngressRuleInfo, ObservabilityContactPointInfo, ObservabilityAlertRuleInfo, EdgeServicesVpcEndpointInfo, AuditTrailCustomAlertRuleInfo, ServerlessContainersNamespaceInfo, ServerlessContainersContainerInfo, ServerlessContainersDomainInfo, ServerlessContainersTriggerInfo, ServerlessFunctionsNamespaceInfo, ServerlessFunctionsFunctionInfo, ServerlessFunctionsDomainInfo, ServerlessFunctionsCronInfo, ServerlessFunctionsTriggerInfo must be set.
Expand Down
7 changes: 7 additions & 0 deletions api/instance/v1/instance_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -6638,6 +6638,8 @@ func (s *API) DeleteIP(req *DeleteIPRequest, opts ...scw.RequestOption) error {
}

// ListPrivateNICs: List all private NICs of a specified Instance.
// Some private NICs, such as those in deleting, detaching, or in error state are
// not listed. We strongly recommend migrating to v2alpha1 to retrieve all private NICs.
func (s *API) ListPrivateNICs(req *ListPrivateNICsRequest, opts ...scw.RequestOption) (*ListPrivateNICsResponse, error) {
var err error

Expand Down Expand Up @@ -6677,6 +6679,11 @@ func (s *API) ListPrivateNICs(req *ListPrivateNICsRequest, opts ...scw.RequestOp
}

// CreatePrivateNIC: Create a private NIC connecting an Instance to a Private Network.
// Some private NICs, such as those in deleting, detaching, or in error state are
// not listed in v1.
// Therefore, you may encounter quota limits errors when creating a new private NIC, even if your visible
// count is below the threshold.
// We strongly recommend migrating to v2alpha1 to see all private NICs.
func (s *API) CreatePrivateNIC(req *CreatePrivateNICRequest, opts ...scw.RequestOption) (*CreatePrivateNICResponse, error) {
var err error

Expand Down
68 changes: 66 additions & 2 deletions api/instance/v2alpha1/instance_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,12 @@ const (
PrivateNetworkInterfaceStatusDetaching = PrivateNetworkInterfaceStatus("detaching")
// Attached, detached, or when the associated security-group rules are being updated on the interface.
PrivateNetworkInterfaceStatusSyncing = PrivateNetworkInterfaceStatus("syncing")
// Interface is being deleted.
PrivateNetworkInterfaceStatusDeleting = PrivateNetworkInterfaceStatus("deleting")
// Stop the server to fix the issue.
PrivateNetworkInterfaceStatusDetachError = PrivateNetworkInterfaceStatus("detach_error")
// Stop the server to fix the issue.
PrivateNetworkInterfaceStatusDeleteError = PrivateNetworkInterfaceStatus("delete_error")
)

func (enum PrivateNetworkInterfaceStatus) String() string {
Expand All @@ -535,6 +541,9 @@ func (enum PrivateNetworkInterfaceStatus) Values() []PrivateNetworkInterfaceStat
"attaching",
"detaching",
"syncing",
"deleting",
"detach_error",
"delete_error",
}
}

Expand Down Expand Up @@ -874,6 +883,12 @@ const (
ServerPrivateNetworkInterfaceStatusDetaching = ServerPrivateNetworkInterfaceStatus("detaching")
// The associated security-group rules are being updated on the interface.
ServerPrivateNetworkInterfaceStatusSyncing = ServerPrivateNetworkInterfaceStatus("syncing")
// Interface is being deleted.
ServerPrivateNetworkInterfaceStatusDeleting = ServerPrivateNetworkInterfaceStatus("deleting")
// Stop the server to fix the issue.
ServerPrivateNetworkInterfaceStatusDetachError = ServerPrivateNetworkInterfaceStatus("detach_error")
// Stop the server to fix the issue.
ServerPrivateNetworkInterfaceStatusDeleteError = ServerPrivateNetworkInterfaceStatus("delete_error")
)

func (enum ServerPrivateNetworkInterfaceStatus) String() string {
Expand All @@ -891,6 +906,9 @@ func (enum ServerPrivateNetworkInterfaceStatus) Values() []ServerPrivateNetworkI
"attaching",
"detaching",
"syncing",
"deleting",
"detach_error",
"delete_error",
}
}

Expand Down Expand Up @@ -2301,11 +2319,11 @@ type DeleteServerRequest struct {
// Precisely one of DeleteAllIPs, DeleteIPIDs must be set.
DeleteIPIDs *[]string `json:"delete_ip_ids,omitempty"`

// DeleteAllVolumes: whether to delete all volumes attached to the server.
// DeleteAllVolumes: whether to delete all volumes attached to the server. Deletion of SBS volumes is not supported yet.
// Precisely one of DeleteAllVolumes, DeleteVolumeIDs must be set.
DeleteAllVolumes *bool `json:"delete_all_volumes,omitempty"`

// DeleteVolumeIDs: list of volume IDs to delete.
// DeleteVolumeIDs: list of volume IDs to delete. Deletion of SBS volumes is not supported yet.
// Precisely one of DeleteAllVolumes, DeleteVolumeIDs must be set.
DeleteVolumeIDs *[]string `json:"delete_volume_ids,omitempty"`

Expand Down Expand Up @@ -2351,6 +2369,15 @@ type DeleteUserDataRequest struct {
Key string `json:"-"`
}

// DetachAndDeletePrivateNetworkInterfaceRequest: detach and delete private network interface request.
type DetachAndDeletePrivateNetworkInterfaceRequest struct {
// Zone: zone to target. If none is passed will use default zone from the config.
Zone scw.Zone `json:"-"`

// PrivateNetworkInterfaceID: ID of the private network interface to detach and delete.
PrivateNetworkInterfaceID string `json:"-"`
}

// DetachServerFileSystemRequest: detach server file system request.
type DetachServerFileSystemRequest struct {
// Zone: zone to target. If none is passed will use default zone from the config.
Expand Down Expand Up @@ -4801,6 +4828,7 @@ func (s *API) WaitForPrivateNetworkInterface(req *WaitForPrivateNetworkInterface
PrivateNetworkInterfaceStatusAttaching: {},
PrivateNetworkInterfaceStatusDetaching: {},
PrivateNetworkInterfaceStatusSyncing: {},
PrivateNetworkInterfaceStatusDeleting: {},
}

res, err := async.WaitSync(&async.WaitSyncConfig{
Expand Down Expand Up @@ -4892,6 +4920,42 @@ func (s *API) DeletePrivateNetworkInterface(req *DeletePrivateNetworkInterfaceRe
return nil
}

// DetachAndDeletePrivateNetworkInterface:
func (s *API) DetachAndDeletePrivateNetworkInterface(req *DetachAndDeletePrivateNetworkInterfaceRequest, opts ...scw.RequestOption) (*PrivateNetworkInterface, error) {
var err error

if req.Zone == "" {
defaultZone, _ := s.client.GetDefaultZone()
req.Zone = defaultZone
}

if fmt.Sprint(req.Zone) == "" {
return nil, errors.New("field Zone cannot be empty in request")
}

if fmt.Sprint(req.PrivateNetworkInterfaceID) == "" {
return nil, errors.New("field PrivateNetworkInterfaceID cannot be empty in request")
}

scwReq := &scw.ScalewayRequest{
Method: "POST",
Path: "/instance/v2alpha1/zones/" + fmt.Sprint(req.Zone) + "/private-network-interfaces/" + fmt.Sprint(req.PrivateNetworkInterfaceID) + "/detach-and-delete",
}

err = scwReq.SetBody(req)
if err != nil {
return nil, err
}

var resp PrivateNetworkInterface

err = s.client.Do(scwReq, &resp, opts...)
if err != nil {
return nil, err
}
return &resp, nil
}

// ListPlacementGroups: List all placement groups.
func (s *API) ListPlacementGroups(req *ListPlacementGroupsRequest, opts ...scw.RequestOption) (*ListPlacementGroupsResponse, error) {
var err error
Expand Down
59 changes: 51 additions & 8 deletions api/key_manager/v1alpha1/key_manager_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ const (
KeyAlgorithmAsymmetricEncryptionRsaOaep3072Sha256 = KeyAlgorithmAsymmetricEncryption("rsa_oaep_3072_sha256")
// RSA-OAEP (Optimal Asymmetric Encryption Padding) with a 4096-bit key and SHA-256 hash function.
KeyAlgorithmAsymmetricEncryptionRsaOaep4096Sha256 = KeyAlgorithmAsymmetricEncryption("rsa_oaep_4096_sha256")
KeyAlgorithmAsymmetricEncryptionMlKem768 = KeyAlgorithmAsymmetricEncryption("ml_kem_768")
KeyAlgorithmAsymmetricEncryptionMlKem1024 = KeyAlgorithmAsymmetricEncryption("ml_kem_1024")
)

func (enum KeyAlgorithmAsymmetricEncryption) String() string {
Expand All @@ -106,8 +104,6 @@ func (enum KeyAlgorithmAsymmetricEncryption) Values() []KeyAlgorithmAsymmetricEn
"rsa_oaep_2048_sha256",
"rsa_oaep_3072_sha256",
"rsa_oaep_4096_sha256",
"ml_kem_768",
"ml_kem_1024",
}
}

Expand Down Expand Up @@ -151,7 +147,8 @@ const (
// ML-DSA (Module-Lattice Digital Signature Algorithm) FIPS 204 post-quantum signature scheme with security category 3.
KeyAlgorithmAsymmetricSigningMlDsa65 = KeyAlgorithmAsymmetricSigning("ml_dsa_65")
// ML-DSA (Module-Lattice Digital Signature Algorithm) FIPS 204 post-quantum signature scheme with security category 5.
KeyAlgorithmAsymmetricSigningMlDsa87 = KeyAlgorithmAsymmetricSigning("ml_dsa_87")
KeyAlgorithmAsymmetricSigningMlDsa87 = KeyAlgorithmAsymmetricSigning("ml_dsa_87")
KeyAlgorithmAsymmetricSigningEcSecp256k1Sha256 = KeyAlgorithmAsymmetricSigning("ec_secp256k1_sha256")
)

func (enum KeyAlgorithmAsymmetricSigning) String() string {
Expand All @@ -176,6 +173,7 @@ func (enum KeyAlgorithmAsymmetricSigning) Values() []KeyAlgorithmAsymmetricSigni
"ml_dsa_44",
"ml_dsa_65",
"ml_dsa_87",
"ec_secp256k1_sha256",
}
}

Expand All @@ -194,6 +192,45 @@ func (enum *KeyAlgorithmAsymmetricSigning) UnmarshalJSON(data []byte) error {
return nil
}

type KeyAlgorithmKeyEncapsulation string

const (
KeyAlgorithmKeyEncapsulationUnknownKeyEncapsulation = KeyAlgorithmKeyEncapsulation("unknown_key_encapsulation")
KeyAlgorithmKeyEncapsulationMlKem768 = KeyAlgorithmKeyEncapsulation("ml_kem_768")
KeyAlgorithmKeyEncapsulationMlKem1024 = KeyAlgorithmKeyEncapsulation("ml_kem_1024")
)

func (enum KeyAlgorithmKeyEncapsulation) String() string {
if enum == "" {
// return default value if empty
return string(KeyAlgorithmKeyEncapsulationUnknownKeyEncapsulation)
}
return string(enum)
}

func (enum KeyAlgorithmKeyEncapsulation) Values() []KeyAlgorithmKeyEncapsulation {
return []KeyAlgorithmKeyEncapsulation{
"unknown_key_encapsulation",
"ml_kem_768",
"ml_kem_1024",
}
}

func (enum KeyAlgorithmKeyEncapsulation) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}

func (enum *KeyAlgorithmKeyEncapsulation) UnmarshalJSON(data []byte) error {
tmp := ""

if err := json.Unmarshal(data, &tmp); err != nil {
return err
}

*enum = KeyAlgorithmKeyEncapsulation(KeyAlgorithmKeyEncapsulation(tmp).String())
return nil
}

type KeyAlgorithmSymmetricEncryption string

const (
Expand Down Expand Up @@ -326,6 +363,7 @@ const (
ListAlgorithmsRequestUsageSymmetricEncryption = ListAlgorithmsRequestUsage("symmetric_encryption")
ListAlgorithmsRequestUsageAsymmetricEncryption = ListAlgorithmsRequestUsage("asymmetric_encryption")
ListAlgorithmsRequestUsageAsymmetricSigning = ListAlgorithmsRequestUsage("asymmetric_signing")
ListAlgorithmsRequestUsageKeyEncapsulation = ListAlgorithmsRequestUsage("key_encapsulation")
)

func (enum ListAlgorithmsRequestUsage) String() string {
Expand All @@ -342,6 +380,7 @@ func (enum ListAlgorithmsRequestUsage) Values() []ListAlgorithmsRequestUsage {
"symmetric_encryption",
"asymmetric_encryption",
"asymmetric_signing",
"key_encapsulation",
}
}

Expand Down Expand Up @@ -459,18 +498,22 @@ type KeyRotationPolicy struct {
type KeyUsage struct {
// SymmetricEncryption: see the `Key.Algorithm.SymmetricEncryption` enum for a description of values.
// Default value: unknown_symmetric_encryption
// Precisely one of SymmetricEncryption, AsymmetricEncryption, AsymmetricSigning must be set.
// Precisely one of SymmetricEncryption, AsymmetricEncryption, AsymmetricSigning, KeyEncapsulation must be set.
SymmetricEncryption *KeyAlgorithmSymmetricEncryption `json:"symmetric_encryption,omitempty"`

// AsymmetricEncryption: see the `Key.Algorithm.AsymmetricEncryption` enum for a description of values.
// Default value: unknown_asymmetric_encryption
// Precisely one of SymmetricEncryption, AsymmetricEncryption, AsymmetricSigning must be set.
// Precisely one of SymmetricEncryption, AsymmetricEncryption, AsymmetricSigning, KeyEncapsulation must be set.
AsymmetricEncryption *KeyAlgorithmAsymmetricEncryption `json:"asymmetric_encryption,omitempty"`

// AsymmetricSigning: see the `Key.Algorithm.AsymmetricSigning` enum for a description of values.
// Default value: unknown_asymmetric_signing
// Precisely one of SymmetricEncryption, AsymmetricEncryption, AsymmetricSigning must be set.
// Precisely one of SymmetricEncryption, AsymmetricEncryption, AsymmetricSigning, KeyEncapsulation must be set.
AsymmetricSigning *KeyAlgorithmAsymmetricSigning `json:"asymmetric_signing,omitempty"`

// KeyEncapsulation: default value: unknown_key_encapsulation
// Precisely one of SymmetricEncryption, AsymmetricEncryption, AsymmetricSigning, KeyEncapsulation must be set.
KeyEncapsulation *KeyAlgorithmKeyEncapsulation `json:"key_encapsulation,omitempty"`
}

// ListAlgorithmsResponseAlgorithm: list algorithms response algorithm.
Expand Down
Loading
Loading