Merge pull request #15658 from hakman/update_scaleway-sdk-go

Update scaleway-sdk-go to v1.0.0-beta.19
This commit is contained in:
Kubernetes Prow Robot 2023-07-17 21:01:08 -07:00 committed by GitHub
commit 4fd8a66d70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 733 additions and 280 deletions

2
go.mod
View File

@ -33,7 +33,7 @@ require (
github.com/pelletier/go-toml v1.9.5 github.com/pelletier/go-toml v1.9.5
github.com/pkg/sftp v1.13.5 github.com/pkg/sftp v1.13.5
github.com/prometheus/client_golang v1.16.0 github.com/prometheus/client_golang v1.16.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17 github.com/scaleway/scaleway-sdk-go v1.0.0-beta.19
github.com/sergi/go-diff v1.3.1 github.com/sergi/go-diff v1.3.1
github.com/spf13/cobra v1.7.0 github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5 github.com/spf13/pflag v1.0.5

4
go.sum
View File

@ -611,8 +611,8 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI=
github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17 h1:1WuWJu7/e8SqK+uQl7lfk/N/oMZTL2NE/TJsNKRNMc4= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.19 h1:+1H+N9QFl2Sfvia0FBYfMrHYHYhmpZxhSE0wpPL2lYs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.19/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=

View File

@ -173,8 +173,8 @@ func (_ *Instance) RenderScw(t *scaleway.ScwAPITarget, actual, expected, changes
} }
createServerRequest.Volumes = map[string]*instance.VolumeServerTemplate{ createServerRequest.Volumes = map[string]*instance.VolumeServerTemplate{
"0": { "0": {
Boot: true, Boot: fi.PtrTo(true),
Size: scw.GB * 50, Size: fi.PtrTo(scw.GB * 50),
VolumeType: instance.VolumeVolumeTypeBSSD, VolumeType: instance.VolumeVolumeTypeBSSD,
}, },
} }

View File

@ -68,10 +68,14 @@ func NewRegistrarAPI(client *scw.Client) *RegistrarAPI {
type ContactEmailStatus string type ContactEmailStatus string
const ( const (
// If unspecified, the status is unknown by default.
ContactEmailStatusEmailStatusUnknown = ContactEmailStatus("email_status_unknown") ContactEmailStatusEmailStatusUnknown = ContactEmailStatus("email_status_unknown")
ContactEmailStatusValidated = ContactEmailStatus("validated") // The contact email has been validated.
ContactEmailStatusNotValidated = ContactEmailStatus("not_validated") ContactEmailStatusValidated = ContactEmailStatus("validated")
ContactEmailStatusInvalidEmail = ContactEmailStatus("invalid_email") // The contact email has not been validated.
ContactEmailStatusNotValidated = ContactEmailStatus("not_validated")
// The contact email is invalid.
ContactEmailStatusInvalidEmail = ContactEmailStatus("invalid_email")
) )
func (enum ContactEmailStatus) String() string { func (enum ContactEmailStatus) String() string {
@ -100,14 +104,22 @@ func (enum *ContactEmailStatus) UnmarshalJSON(data []byte) error {
type ContactExtensionFRMode string type ContactExtensionFRMode string
const ( const (
ContactExtensionFRModeModeUnknown = ContactExtensionFRMode("mode_unknown") // If unspecified, the status is unknown by default.
ContactExtensionFRModeIndividual = ContactExtensionFRMode("individual") ContactExtensionFRModeModeUnknown = ContactExtensionFRMode("mode_unknown")
// The contact is a physical person (only for .fr domains).
ContactExtensionFRModeIndividual = ContactExtensionFRMode("individual")
// The contact is a company with a SIRET/SIREN code (only for .fr domains).
ContactExtensionFRModeCompanyIdentificationCode = ContactExtensionFRMode("company_identification_code") ContactExtensionFRModeCompanyIdentificationCode = ContactExtensionFRMode("company_identification_code")
ContactExtensionFRModeDuns = ContactExtensionFRMode("duns") // The contact has a Data Universal Numbering System code (only for .fr domains).
ContactExtensionFRModeLocal = ContactExtensionFRMode("local") ContactExtensionFRModeDuns = ContactExtensionFRMode("duns")
ContactExtensionFRModeAssociation = ContactExtensionFRMode("association") // The contact has a local or a country ID (only for .fr domains).
ContactExtensionFRModeTrademark = ContactExtensionFRMode("trademark") ContactExtensionFRModeLocal = ContactExtensionFRMode("local")
ContactExtensionFRModeCodeAuthAfnic = ContactExtensionFRMode("code_auth_afnic") // The contact is an association (only for .fr domains).
ContactExtensionFRModeAssociation = ContactExtensionFRMode("association")
// The contact is a brand (only for .fr domains).
ContactExtensionFRModeTrademark = ContactExtensionFRMode("trademark")
// The contact has an intervention code (DSIA) from AFNIC (only for .fr domains).
ContactExtensionFRModeCodeAuthAfnic = ContactExtensionFRMode("code_auth_afnic")
) )
func (enum ContactExtensionFRMode) String() string { func (enum ContactExtensionFRMode) String() string {
@ -136,26 +148,46 @@ func (enum *ContactExtensionFRMode) UnmarshalJSON(data []byte) error {
type ContactExtensionNLLegalForm string type ContactExtensionNLLegalForm string
const ( const (
ContactExtensionNLLegalFormLegalFormUnknown = ContactExtensionNLLegalForm("legal_form_unknown") // If unspecified, the status is unknown by default.
ContactExtensionNLLegalFormOther = ContactExtensionNLLegalForm("other") ContactExtensionNLLegalFormLegalFormUnknown = ContactExtensionNLLegalForm("legal_form_unknown")
ContactExtensionNLLegalFormNonDutchEuCompany = ContactExtensionNLLegalForm("non_dutch_eu_company") // The contact's legal form is not listed below (only for .nl domains).
ContactExtensionNLLegalFormOther = ContactExtensionNLLegalForm("other")
// The contact is a non-Dutch EC company (only for .nl domains).
ContactExtensionNLLegalFormNonDutchEuCompany = ContactExtensionNLLegalForm("non_dutch_eu_company")
// The contact is a non-Dutch legal form/enterprise/subsidiary (only for .nl domains).
ContactExtensionNLLegalFormNonDutchLegalFormEnterpriseSubsidiary = ContactExtensionNLLegalForm("non_dutch_legal_form_enterprise_subsidiary") ContactExtensionNLLegalFormNonDutchLegalFormEnterpriseSubsidiary = ContactExtensionNLLegalForm("non_dutch_legal_form_enterprise_subsidiary")
ContactExtensionNLLegalFormLimitedCompany = ContactExtensionNLLegalForm("limited_company") // The contact is a limited company (only for .nl domains).
ContactExtensionNLLegalFormLimitedCompanyInFormation = ContactExtensionNLLegalForm("limited_company_in_formation") ContactExtensionNLLegalFormLimitedCompany = ContactExtensionNLLegalForm("limited_company")
ContactExtensionNLLegalFormCooperative = ContactExtensionNLLegalForm("cooperative") // The contact is a limited company in formation (only for .nl domains).
ContactExtensionNLLegalFormLimitedPartnership = ContactExtensionNLLegalForm("limited_partnership") ContactExtensionNLLegalFormLimitedCompanyInFormation = ContactExtensionNLLegalForm("limited_company_in_formation")
ContactExtensionNLLegalFormSoleCompany = ContactExtensionNLLegalForm("sole_company") // The contact is a cooperative (only for .nl domains).
ContactExtensionNLLegalFormEuropeanEconomicInterestGroup = ContactExtensionNLLegalForm("european_economic_interest_group") ContactExtensionNLLegalFormCooperative = ContactExtensionNLLegalForm("cooperative")
ContactExtensionNLLegalFormReligiousEntity = ContactExtensionNLLegalForm("religious_entity") // The contact is a limited Partnership (only for .nl domains).
ContactExtensionNLLegalFormPartnership = ContactExtensionNLLegalForm("partnership") ContactExtensionNLLegalFormLimitedPartnership = ContactExtensionNLLegalForm("limited_partnership")
ContactExtensionNLLegalFormPublicCompany = ContactExtensionNLLegalForm("public_company") // The contact is a sole trader (only for .nl domains).
ContactExtensionNLLegalFormMutualBenefitCompany = ContactExtensionNLLegalForm("mutual_benefit_company") ContactExtensionNLLegalFormSoleCompany = ContactExtensionNLLegalForm("sole_company")
ContactExtensionNLLegalFormResidential = ContactExtensionNLLegalForm("residential") // The contact is a European Economic Interest Group (only for .nl domains).
ContactExtensionNLLegalFormShippingCompany = ContactExtensionNLLegalForm("shipping_company") ContactExtensionNLLegalFormEuropeanEconomicInterestGroup = ContactExtensionNLLegalForm("european_economic_interest_group")
ContactExtensionNLLegalFormFoundation = ContactExtensionNLLegalForm("foundation") // The contact is a religious society (only for .nl domains).
ContactExtensionNLLegalFormAssociation = ContactExtensionNLLegalForm("association") ContactExtensionNLLegalFormReligiousEntity = ContactExtensionNLLegalForm("religious_entity")
ContactExtensionNLLegalFormTradingPartnership = ContactExtensionNLLegalForm("trading_partnership") // The contact is a partnership (only for .nl domains).
ContactExtensionNLLegalFormNaturalPerson = ContactExtensionNLLegalForm("natural_person") ContactExtensionNLLegalFormPartnership = ContactExtensionNLLegalForm("partnership")
// The contact is a public Company (only for .nl domains).
ContactExtensionNLLegalFormPublicCompany = ContactExtensionNLLegalForm("public_company")
// The contact is a mutual benefit company (only for .nl domains).
ContactExtensionNLLegalFormMutualBenefitCompany = ContactExtensionNLLegalForm("mutual_benefit_company")
// The contact is a natural person (only for .nl domains).
ContactExtensionNLLegalFormResidential = ContactExtensionNLLegalForm("residential")
// The contact is a shipping company (only for .nl domains).
ContactExtensionNLLegalFormShippingCompany = ContactExtensionNLLegalForm("shipping_company")
// The contact is a foundation (only for .nl domains).
ContactExtensionNLLegalFormFoundation = ContactExtensionNLLegalForm("foundation")
// The contact is a association (only for .nl domains).
ContactExtensionNLLegalFormAssociation = ContactExtensionNLLegalForm("association")
// The contact is a trading partnership (only for .nl domains).
ContactExtensionNLLegalFormTradingPartnership = ContactExtensionNLLegalForm("trading_partnership")
// The contact is a physical person (only for .nl domains).
ContactExtensionNLLegalFormNaturalPerson = ContactExtensionNLLegalForm("natural_person")
) )
func (enum ContactExtensionNLLegalForm) String() string { func (enum ContactExtensionNLLegalForm) String() string {
@ -184,11 +216,16 @@ func (enum *ContactExtensionNLLegalForm) UnmarshalJSON(data []byte) error {
type ContactLegalForm string type ContactLegalForm string
const ( const (
// If unspecified, the status is unknown by default.
ContactLegalFormLegalFormUnknown = ContactLegalForm("legal_form_unknown") ContactLegalFormLegalFormUnknown = ContactLegalForm("legal_form_unknown")
ContactLegalFormIndividual = ContactLegalForm("individual") // The contact is a physical person.
ContactLegalFormCorporate = ContactLegalForm("corporate") ContactLegalFormIndividual = ContactLegalForm("individual")
ContactLegalFormAssociation = ContactLegalForm("association") // The contact is a corporate or a society.
ContactLegalFormOther = ContactLegalForm("other") ContactLegalFormCorporate = ContactLegalForm("corporate")
// The contact is an association.
ContactLegalFormAssociation = ContactLegalForm("association")
// The contact is not represented by a physical person, a corporate or an association.
ContactLegalFormOther = ContactLegalForm("other")
) )
func (enum ContactLegalForm) String() string { func (enum ContactLegalForm) String() string {
@ -217,11 +254,16 @@ func (enum *ContactLegalForm) UnmarshalJSON(data []byte) error {
type DNSZoneStatus string type DNSZoneStatus string
const ( const (
// If unspecified, the DNS zone's status is unknown by default
DNSZoneStatusUnknown = DNSZoneStatus("unknown") DNSZoneStatusUnknown = DNSZoneStatus("unknown")
DNSZoneStatusActive = DNSZoneStatus("active") // The DNS zone is active and healthy.
DNSZoneStatusActive = DNSZoneStatus("active")
// The DNS zone is updating.
DNSZoneStatusPending = DNSZoneStatus("pending") DNSZoneStatusPending = DNSZoneStatus("pending")
DNSZoneStatusError = DNSZoneStatus("error") // An error occurred after updating the DNS zone.
DNSZoneStatusLocked = DNSZoneStatus("locked") DNSZoneStatusError = DNSZoneStatus("error")
// The DNS zone is locked and cannot be updated anymore.
DNSZoneStatusLocked = DNSZoneStatus("locked")
) )
func (enum DNSZoneStatus) String() string { func (enum DNSZoneStatus) String() string {
@ -250,19 +292,32 @@ func (enum *DNSZoneStatus) UnmarshalJSON(data []byte) error {
type DSRecordAlgorithm string type DSRecordAlgorithm string
const ( const (
DSRecordAlgorithmRsamd5 = DSRecordAlgorithm("rsamd5") // Code 1, algorithm: 'RSAMD5'.
DSRecordAlgorithmDh = DSRecordAlgorithm("dh") DSRecordAlgorithmRsamd5 = DSRecordAlgorithm("rsamd5")
DSRecordAlgorithmDsa = DSRecordAlgorithm("dsa") // Code 2, algorithm: 'DIFFIE_HELLMAN'.
DSRecordAlgorithmRsasha1 = DSRecordAlgorithm("rsasha1") DSRecordAlgorithmDh = DSRecordAlgorithm("dh")
DSRecordAlgorithmDsaNsec3Sha1 = DSRecordAlgorithm("dsa_nsec3_sha1") // Code 3, algorithm: 'DSA_SHA1'.
DSRecordAlgorithmDsa = DSRecordAlgorithm("dsa")
// Code 5, algorithm: 'RSA_SHA1'.
DSRecordAlgorithmRsasha1 = DSRecordAlgorithm("rsasha1")
// Code 6, algorithm: 'DSA_NSEC3_SHA1'.
DSRecordAlgorithmDsaNsec3Sha1 = DSRecordAlgorithm("dsa_nsec3_sha1")
// Code 7, algorithm: 'RSASHA1_NSEC3_SHA1'.
DSRecordAlgorithmRsasha1Nsec3Sha1 = DSRecordAlgorithm("rsasha1_nsec3_sha1") DSRecordAlgorithmRsasha1Nsec3Sha1 = DSRecordAlgorithm("rsasha1_nsec3_sha1")
DSRecordAlgorithmRsasha256 = DSRecordAlgorithm("rsasha256") // Code 8, algorithm: 'RSASHA256'.
DSRecordAlgorithmRsasha512 = DSRecordAlgorithm("rsasha512") DSRecordAlgorithmRsasha256 = DSRecordAlgorithm("rsasha256")
DSRecordAlgorithmEccGost = DSRecordAlgorithm("ecc_gost") // Code 10, algorithm: 'RSASHA512'.
DSRecordAlgorithmEcdsap256sha256 = DSRecordAlgorithm("ecdsap256sha256") DSRecordAlgorithmRsasha512 = DSRecordAlgorithm("rsasha512")
DSRecordAlgorithmEcdsap384sha384 = DSRecordAlgorithm("ecdsap384sha384") // Code 12, algorithm: 'ECC_GOST'.
DSRecordAlgorithmEd25519 = DSRecordAlgorithm("ed25519") DSRecordAlgorithmEccGost = DSRecordAlgorithm("ecc_gost")
DSRecordAlgorithmEd448 = DSRecordAlgorithm("ed448") // Code 13, algorithm: 'ECDSAP256SHA256'.
DSRecordAlgorithmEcdsap256sha256 = DSRecordAlgorithm("ecdsap256sha256")
// Code 14, algorithm: 'ECDSAP384SHA384'.
DSRecordAlgorithmEcdsap384sha384 = DSRecordAlgorithm("ecdsap384sha384")
// Code 15, algorithm: 'ED25519'.
DSRecordAlgorithmEd25519 = DSRecordAlgorithm("ed25519")
// Code 16, algorithm: 'ED448'.
DSRecordAlgorithmEd448 = DSRecordAlgorithm("ed448")
) )
func (enum DSRecordAlgorithm) String() string { func (enum DSRecordAlgorithm) String() string {
@ -291,10 +346,14 @@ func (enum *DSRecordAlgorithm) UnmarshalJSON(data []byte) error {
type DSRecordDigestType string type DSRecordDigestType string
const ( const (
DSRecordDigestTypeSha1 = DSRecordDigestType("sha_1") // Code 1, digest type: 'SHA_1'.
DSRecordDigestTypeSha256 = DSRecordDigestType("sha_256") DSRecordDigestTypeSha1 = DSRecordDigestType("sha_1")
// Code 2, digest type: 'SHA_256'.
DSRecordDigestTypeSha256 = DSRecordDigestType("sha_256")
// Code 3, digest type: 'GOST_R_34_11_94'.
DSRecordDigestTypeGostR34_11_94 = DSRecordDigestType("gost_r_34_11_94") DSRecordDigestTypeGostR34_11_94 = DSRecordDigestType("gost_r_34_11_94")
DSRecordDigestTypeSha384 = DSRecordDigestType("sha_384") // Code 4, digest type: 'SHA_384'.
DSRecordDigestTypeSha384 = DSRecordDigestType("sha_384")
) )
func (enum DSRecordDigestType) String() string { func (enum DSRecordDigestType) String() string {
@ -323,11 +382,16 @@ func (enum *DSRecordDigestType) UnmarshalJSON(data []byte) error {
type DomainFeatureStatus string type DomainFeatureStatus string
const ( const (
// Default unknown status.
DomainFeatureStatusFeatureStatusUnknown = DomainFeatureStatus("feature_status_unknown") DomainFeatureStatusFeatureStatusUnknown = DomainFeatureStatus("feature_status_unknown")
DomainFeatureStatusEnabling = DomainFeatureStatus("enabling") // A feature (auto renew, DNSSEC) is being enabled.
DomainFeatureStatusEnabled = DomainFeatureStatus("enabled") DomainFeatureStatusEnabling = DomainFeatureStatus("enabling")
DomainFeatureStatusDisabling = DomainFeatureStatus("disabling") // A feature (auto renew, DNSSEC) has been enabled.
DomainFeatureStatusDisabled = DomainFeatureStatus("disabled") DomainFeatureStatusEnabled = DomainFeatureStatus("enabled")
// A feature (auto renew, DNSSEC) is being disabled.
DomainFeatureStatusDisabling = DomainFeatureStatus("disabling")
// A feature (auto renew, DNSSEC) has been disabled.
DomainFeatureStatusDisabled = DomainFeatureStatus("disabled")
) )
func (enum DomainFeatureStatus) String() string { func (enum DomainFeatureStatus) String() string {
@ -356,12 +420,18 @@ func (enum *DomainFeatureStatus) UnmarshalJSON(data []byte) error {
type DomainRegistrationStatusTransferStatus string type DomainRegistrationStatusTransferStatus string
const ( const (
// If unspecified, the status is unknown by default.
DomainRegistrationStatusTransferStatusStatusUnknown = DomainRegistrationStatusTransferStatus("status_unknown") DomainRegistrationStatusTransferStatusStatusUnknown = DomainRegistrationStatusTransferStatus("status_unknown")
DomainRegistrationStatusTransferStatusPending = DomainRegistrationStatusTransferStatus("pending") // The domain transfer is being initialized.
DomainRegistrationStatusTransferStatusWaitingVote = DomainRegistrationStatusTransferStatus("waiting_vote") DomainRegistrationStatusTransferStatusPending = DomainRegistrationStatusTransferStatus("pending")
DomainRegistrationStatusTransferStatusRejected = DomainRegistrationStatusTransferStatus("rejected") // The domain transfer has started. The process can be accelerated if you accept the vote.
DomainRegistrationStatusTransferStatusProcessing = DomainRegistrationStatusTransferStatus("processing") DomainRegistrationStatusTransferStatusWaitingVote = DomainRegistrationStatusTransferStatus("waiting_vote")
DomainRegistrationStatusTransferStatusDone = DomainRegistrationStatusTransferStatus("done") // The domain transfer has been rejected.
DomainRegistrationStatusTransferStatusRejected = DomainRegistrationStatusTransferStatus("rejected")
// The domain transfer has been accepted. Your resources are being created.
DomainRegistrationStatusTransferStatusProcessing = DomainRegistrationStatusTransferStatus("processing")
// The domain transfer is complete.
DomainRegistrationStatusTransferStatusDone = DomainRegistrationStatusTransferStatus("done")
) )
func (enum DomainRegistrationStatusTransferStatus) String() string { func (enum DomainRegistrationStatusTransferStatus) String() string {
@ -390,20 +460,34 @@ func (enum *DomainRegistrationStatusTransferStatus) UnmarshalJSON(data []byte) e
type DomainStatus string type DomainStatus string
const ( const (
// If unspecified, the status is unknown by default.
DomainStatusStatusUnknown = DomainStatus("status_unknown") DomainStatusStatusUnknown = DomainStatus("status_unknown")
DomainStatusActive = DomainStatus("active") // The domain is active.
DomainStatusCreating = DomainStatus("creating") DomainStatusActive = DomainStatus("active")
DomainStatusCreateError = DomainStatus("create_error") // The domain is in the process of being created.
DomainStatusRenewing = DomainStatus("renewing") DomainStatusCreating = DomainStatus("creating")
DomainStatusRenewError = DomainStatus("renew_error") // An error occurred during the domain's creation process.
DomainStatusXfering = DomainStatus("xfering") DomainStatusCreateError = DomainStatus("create_error")
DomainStatusXferError = DomainStatus("xfer_error") // The domain is being renewed.
DomainStatusExpired = DomainStatus("expired") DomainStatusRenewing = DomainStatus("renewing")
DomainStatusExpiring = DomainStatus("expiring") // An error occurred during the domain's renewal process.
DomainStatusUpdating = DomainStatus("updating") DomainStatusRenewError = DomainStatus("renew_error")
DomainStatusChecking = DomainStatus("checking") // The domain is being transferred to Scaleway Domains and DNS.
DomainStatusLocked = DomainStatus("locked") DomainStatusXfering = DomainStatus("xfering")
DomainStatusDeleting = DomainStatus("deleting") // An error occurred during the domain's transfer process.
DomainStatusXferError = DomainStatus("xfer_error")
// The domain is expired but it can be renewed.
DomainStatusExpired = DomainStatus("expired")
// The domain is expiring but it is still renewable.
DomainStatusExpiring = DomainStatus("expiring")
// The domain's information is updating.
DomainStatusUpdating = DomainStatus("updating")
// The external domain has not yet been validated. It will be automatically removed after 48 hours if it still has not been validated by then.
DomainStatusChecking = DomainStatus("checking")
// The domain is locked. Contact Scaleway's support team for more information.
DomainStatusLocked = DomainStatus("locked")
// The domain will be deleted soon. This process cannot be canceled.
DomainStatusDeleting = DomainStatus("deleting")
) )
func (enum DomainStatus) String() string { func (enum DomainStatus) String() string {
@ -432,10 +516,14 @@ func (enum *DomainStatus) UnmarshalJSON(data []byte) error {
type HostStatus string type HostStatus string
const ( const (
// If unspecified, the status is unknown by default.
HostStatusUnknownStatus = HostStatus("unknown_status") HostStatusUnknownStatus = HostStatus("unknown_status")
HostStatusActive = HostStatus("active") // The host is active.
HostStatusUpdating = HostStatus("updating") HostStatusActive = HostStatus("active")
HostStatusDeleting = HostStatus("deleting") // The host is being updated.
HostStatusUpdating = HostStatus("updating")
// The host is being deleted.
HostStatusDeleting = HostStatus("deleting")
) )
func (enum HostStatus) String() string { func (enum HostStatus) String() string {
@ -496,7 +584,9 @@ func (enum *LanguageCode) UnmarshalJSON(data []byte) error {
type ListDNSZoneRecordsRequestOrderBy string type ListDNSZoneRecordsRequestOrderBy string
const ( const (
ListDNSZoneRecordsRequestOrderByNameAsc = ListDNSZoneRecordsRequestOrderBy("name_asc") // Order by record name (ascending).
ListDNSZoneRecordsRequestOrderByNameAsc = ListDNSZoneRecordsRequestOrderBy("name_asc")
// Order by record name (descending).
ListDNSZoneRecordsRequestOrderByNameDesc = ListDNSZoneRecordsRequestOrderBy("name_desc") ListDNSZoneRecordsRequestOrderByNameDesc = ListDNSZoneRecordsRequestOrderBy("name_desc")
) )
@ -526,9 +616,13 @@ func (enum *ListDNSZoneRecordsRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListDNSZonesRequestOrderBy string type ListDNSZonesRequestOrderBy string
const ( const (
ListDNSZonesRequestOrderByDomainAsc = ListDNSZonesRequestOrderBy("domain_asc") // Order by domain name (ascending).
ListDNSZonesRequestOrderByDomainDesc = ListDNSZonesRequestOrderBy("domain_desc") ListDNSZonesRequestOrderByDomainAsc = ListDNSZonesRequestOrderBy("domain_asc")
ListDNSZonesRequestOrderBySubdomainAsc = ListDNSZonesRequestOrderBy("subdomain_asc") // Order by domain name (descending).
ListDNSZonesRequestOrderByDomainDesc = ListDNSZonesRequestOrderBy("domain_desc")
// Order by subdomain name (ascending).
ListDNSZonesRequestOrderBySubdomainAsc = ListDNSZonesRequestOrderBy("subdomain_asc")
// Order by subdomain name (descending).
ListDNSZonesRequestOrderBySubdomainDesc = ListDNSZonesRequestOrderBy("subdomain_desc") ListDNSZonesRequestOrderBySubdomainDesc = ListDNSZonesRequestOrderBy("subdomain_desc")
) )
@ -558,7 +652,9 @@ func (enum *ListDNSZonesRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListDomainsRequestOrderBy string type ListDomainsRequestOrderBy string
const ( const (
ListDomainsRequestOrderByDomainAsc = ListDomainsRequestOrderBy("domain_asc") // Order by domain name (ascending)
ListDomainsRequestOrderByDomainAsc = ListDomainsRequestOrderBy("domain_asc")
// Order by domain name (descending)
ListDomainsRequestOrderByDomainDesc = ListDomainsRequestOrderBy("domain_desc") ListDomainsRequestOrderByDomainDesc = ListDomainsRequestOrderBy("domain_desc")
) )
@ -588,7 +684,9 @@ func (enum *ListDomainsRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListRenewableDomainsRequestOrderBy string type ListRenewableDomainsRequestOrderBy string
const ( const (
ListRenewableDomainsRequestOrderByDomainAsc = ListRenewableDomainsRequestOrderBy("domain_asc") // Order by domain name (ascending)
ListRenewableDomainsRequestOrderByDomainAsc = ListRenewableDomainsRequestOrderBy("domain_asc")
// Order by domain name (descending)
ListRenewableDomainsRequestOrderByDomainDesc = ListRenewableDomainsRequestOrderBy("domain_desc") ListRenewableDomainsRequestOrderByDomainDesc = ListRenewableDomainsRequestOrderBy("domain_desc")
) )
@ -618,13 +716,21 @@ func (enum *ListRenewableDomainsRequestOrderBy) UnmarshalJSON(data []byte) error
type ListTasksRequestOrderBy string type ListTasksRequestOrderBy string
const ( const (
ListTasksRequestOrderByDomainDesc = ListTasksRequestOrderBy("domain_desc") // Order by domain name (descending)
ListTasksRequestOrderByDomainAsc = ListTasksRequestOrderBy("domain_asc") ListTasksRequestOrderByDomainDesc = ListTasksRequestOrderBy("domain_desc")
ListTasksRequestOrderByTypeAsc = ListTasksRequestOrderBy("type_asc") // Order by domain name (ascending)
ListTasksRequestOrderByTypeDesc = ListTasksRequestOrderBy("type_desc") ListTasksRequestOrderByDomainAsc = ListTasksRequestOrderBy("domain_asc")
ListTasksRequestOrderByStatusAsc = ListTasksRequestOrderBy("status_asc") // Order by type (ascending)
ListTasksRequestOrderByStatusDesc = ListTasksRequestOrderBy("status_desc") ListTasksRequestOrderByTypeAsc = ListTasksRequestOrderBy("type_asc")
ListTasksRequestOrderByUpdatedAtAsc = ListTasksRequestOrderBy("updated_at_asc") // Order by type (descending)
ListTasksRequestOrderByTypeDesc = ListTasksRequestOrderBy("type_desc")
// Order by status (ascending)
ListTasksRequestOrderByStatusAsc = ListTasksRequestOrderBy("status_asc")
// Order by status (descending)
ListTasksRequestOrderByStatusDesc = ListTasksRequestOrderBy("status_desc")
// Order by updated date (ascending)
ListTasksRequestOrderByUpdatedAtAsc = ListTasksRequestOrderBy("updated_at_asc")
// Order by updated date (descending)
ListTasksRequestOrderByUpdatedAtDesc = ListTasksRequestOrderBy("updated_at_desc") ListTasksRequestOrderByUpdatedAtDesc = ListTasksRequestOrderBy("updated_at_desc")
) )
@ -654,8 +760,10 @@ func (enum *ListTasksRequestOrderBy) UnmarshalJSON(data []byte) error {
type RawFormat string type RawFormat string
const ( const (
// If unspecified, the format is unknown by default.
RawFormatUnknownRawFormat = RawFormat("unknown_raw_format") RawFormatUnknownRawFormat = RawFormat("unknown_raw_format")
RawFormatBind = RawFormat("bind") // Export the DNS zone in text bind format
RawFormatBind = RawFormat("bind")
) )
func (enum RawFormat) String() string { func (enum RawFormat) String() string {
@ -684,9 +792,12 @@ func (enum *RawFormat) UnmarshalJSON(data []byte) error {
type RecordHTTPServiceConfigStrategy string type RecordHTTPServiceConfigStrategy string
const ( const (
// Returns a random IP based of the list of IPs available.
RecordHTTPServiceConfigStrategyRandom = RecordHTTPServiceConfigStrategy("random") RecordHTTPServiceConfigStrategyRandom = RecordHTTPServiceConfigStrategy("random")
// Based on the hash of bestwho, returns a random functioning IP out of the best IPs available.
RecordHTTPServiceConfigStrategyHashed = RecordHTTPServiceConfigStrategy("hashed") RecordHTTPServiceConfigStrategyHashed = RecordHTTPServiceConfigStrategy("hashed")
RecordHTTPServiceConfigStrategyAll = RecordHTTPServiceConfigStrategy("all") // Return all functioning IPs available.
RecordHTTPServiceConfigStrategyAll = RecordHTTPServiceConfigStrategy("all")
) )
func (enum RecordHTTPServiceConfigStrategy) String() string { func (enum RecordHTTPServiceConfigStrategy) String() string {
@ -715,26 +826,46 @@ func (enum *RecordHTTPServiceConfigStrategy) UnmarshalJSON(data []byte) error {
type RecordType string type RecordType string
const ( const (
// If unspecified, the record's type is unknown by default.
RecordTypeUnknown = RecordType("unknown") RecordTypeUnknown = RecordType("unknown")
RecordTypeA = RecordType("A") // An A record contains an IP address. Example: '203.0.113.210'.
RecordTypeAAAA = RecordType("AAAA") RecordTypeA = RecordType("A")
RecordTypeCNAME = RecordType("CNAME") // An AAAA record contains an IPv6 address. Example: '2001:DB8:2000:bf0::1'.
RecordTypeTXT = RecordType("TXT") RecordTypeAAAA = RecordType("AAAA")
RecordTypeSRV = RecordType("SRV") // A CNAME record specifies the canonical name of a record. Example 'webserver-01.yourcompany.com'.
RecordTypeTLSA = RecordType("TLSA") RecordTypeCNAME = RecordType("CNAME")
RecordTypeMX = RecordType("MX") // A TXT record can be used to attach textual data to a domain. Example 'v=spf1 include:_spf.tem.scw.cloud -all'.
RecordTypeNS = RecordType("NS") RecordTypeTXT = RecordType("TXT")
RecordTypePTR = RecordType("PTR") // SRV records can be used to encode the location and port of services on a domain name. Example : '20 443 sipdir.scaleway.example.com'.
RecordTypeCAA = RecordType("CAA") RecordTypeSRV = RecordType("SRV")
RecordTypeALIAS = RecordType("ALIAS") // TLSA records are used to bind SSL/TLS certificates to named hosts and ports.
RecordTypeLOC = RecordType("LOC") RecordTypeTLSA = RecordType("TLSA")
RecordTypeSSHFP = RecordType("SSHFP") // An MX record specifies a mail exchanger host for a domain. Example '10 mx.example.net.'.
RecordTypeHINFO = RecordType("HINFO") RecordTypeMX = RecordType("MX")
RecordTypeRP = RecordType("RP") // Specifies nameservers for a domain. Example: 'ns1.yourcompany.com'.
RecordTypeURI = RecordType("URI") RecordTypeNS = RecordType("NS")
RecordTypeDS = RecordType("DS") // A reverse pointer is used to specify the hostname that belongs to an IP or an IPv6 address. Example: 'www.yourcompany.com.'.
RecordTypeNAPTR = RecordType("NAPTR") RecordTypePTR = RecordType("PTR")
RecordTypeDNAME = RecordType("DNAME") // A 'Certification Authority Authorization' record is used to specify certificate authorities that may issue certificates for a domain. Example: '0 issue ca.yourcompany.com'.
RecordTypeCAA = RecordType("CAA")
// The ALIAS pseudo-record type is supported to provide CNAME-like mechanisms on a zone's apex.
RecordTypeALIAS = RecordType("ALIAS")
// A LOC record is a way of expressing geographic location information for a domain name. It contains WGS84 latitude, longitude and altitude. Example: '51 56 0.123 N 5 54 0.000 E 4.00m 1.00m 10000.00m 10.00m'.
RecordTypeLOC = RecordType("LOC")
// An SSHFP record type is used for storing Secure Shell (SSH) fingerprints. Example: '2 1 123456789abcdef67890123456789abcdef67890'.
RecordTypeSSHFP = RecordType("SSHFP")
// A Hardware Info record is used to specify the CPU and operating system you are using. Example: 'i386 Linux'.
RecordTypeHINFO = RecordType("HINFO")
// A Responsible Person record stores the mailbox name and the more-information pointer. Example: 'michel.yourcompany.com michel.people.yourcompany.com', to indicate that michel@yourcompany.com is responsible and that more information about Michel is available by querying the `TXT` record of 'michel.people.yourcompany.com'.
RecordTypeRP = RecordType("RP")
// A URI record, is used to publish mappings from hostnames to URIs. Example: '10 1 'ftp://ftp.yourcompany.com/public'.
RecordTypeURI = RecordType("URI")
// DS records (Delegation Signer) are used to secure delegations (DNSSEC). Example: '2371 13 2 1F987CC6583E92DF0890718C42'.
RecordTypeDS = RecordType("DS")
// A Naming Authority Pointer record is used to set rules for how websites process requests. Example: '100 50 "s" "z3950+I2L+I2C" "" _z3950._tcp.yourcompany.com'.
RecordTypeNAPTR = RecordType("NAPTR")
// A DNAME record provides redirection from one part of the DNS name tree to another part of the DNS name tree. DNAME and CNAME records both cause a lookup to (potentially) return data corresponding to a different domain name from the queried domain name. Example: 'yourcompany.com'.
RecordTypeDNAME = RecordType("DNAME")
) )
func (enum RecordType) String() string { func (enum RecordType) String() string {
@ -763,10 +894,14 @@ func (enum *RecordType) UnmarshalJSON(data []byte) error {
type RenewableDomainStatus string type RenewableDomainStatus string
const ( const (
RenewableDomainStatusUnknown = RenewableDomainStatus("unknown") // If unspecified, the status is unknown by default.
RenewableDomainStatusRenewable = RenewableDomainStatus("renewable") RenewableDomainStatusUnknown = RenewableDomainStatus("unknown")
// The domain can be renewed.
RenewableDomainStatusRenewable = RenewableDomainStatus("renewable")
// The domain is expired, but it still can be late renewed.
RenewableDomainStatusLateReneweable = RenewableDomainStatus("late_reneweable") RenewableDomainStatusLateReneweable = RenewableDomainStatus("late_reneweable")
RenewableDomainStatusNotRenewable = RenewableDomainStatus("not_renewable") // The domain cannot be renewed.
RenewableDomainStatusNotRenewable = RenewableDomainStatus("not_renewable")
) )
func (enum RenewableDomainStatus) String() string { func (enum RenewableDomainStatus) String() string {
@ -795,11 +930,16 @@ func (enum *RenewableDomainStatus) UnmarshalJSON(data []byte) error {
type SSLCertificateStatus string type SSLCertificateStatus string
const ( const (
// If unspecified, the SSL certificate's status is unknown by default.
SSLCertificateStatusUnknown = SSLCertificateStatus("unknown") SSLCertificateStatusUnknown = SSLCertificateStatus("unknown")
SSLCertificateStatusNew = SSLCertificateStatus("new") // The SSL certificate has been created but it has not been processed yet.
SSLCertificateStatusNew = SSLCertificateStatus("new")
// The SSL certificate's status is pending.
SSLCertificateStatusPending = SSLCertificateStatus("pending") SSLCertificateStatusPending = SSLCertificateStatus("pending")
// The SSL certificate has been created and processed.
SSLCertificateStatusSuccess = SSLCertificateStatus("success") SSLCertificateStatusSuccess = SSLCertificateStatus("success")
SSLCertificateStatusError = SSLCertificateStatus("error") // An error occurred during the SSL certificate's creation.
SSLCertificateStatusError = SSLCertificateStatus("error")
) )
func (enum SSLCertificateStatus) String() string { func (enum SSLCertificateStatus) String() string {
@ -828,12 +968,18 @@ func (enum *SSLCertificateStatus) UnmarshalJSON(data []byte) error {
type TaskStatus string type TaskStatus string
const ( const (
TaskStatusUnavailable = TaskStatus("unavailable") // If unspecified, the status is unavailable by default.
TaskStatusNew = TaskStatus("new") TaskStatusUnavailable = TaskStatus("unavailable")
// The task has been created but it has not yet started.
TaskStatusNew = TaskStatus("new")
// The task is waiting for a payment to be validated.
TaskStatusWaitingPayment = TaskStatus("waiting_payment") TaskStatusWaitingPayment = TaskStatus("waiting_payment")
TaskStatusPending = TaskStatus("pending") // The task is pending.
TaskStatusSuccess = TaskStatus("success") TaskStatusPending = TaskStatus("pending")
TaskStatusError = TaskStatus("error") // The task has been completed.
TaskStatusSuccess = TaskStatus("success")
// The task is in an error state.
TaskStatusError = TaskStatus("error")
) )
func (enum TaskStatus) String() string { func (enum TaskStatus) String() string {
@ -862,28 +1008,50 @@ func (enum *TaskStatus) UnmarshalJSON(data []byte) error {
type TaskType string type TaskType string
const ( const (
TaskTypeUnknown = TaskType("unknown") // If unspecified, the status is unknown by default.
TaskTypeCreateDomain = TaskType("create_domain") TaskTypeUnknown = TaskType("unknown")
TaskTypeCreateExternalDomain = TaskType("create_external_domain") // Create a new internal domain.
TaskTypeRenewDomain = TaskType("renew_domain") TaskTypeCreateDomain = TaskType("create_domain")
TaskTypeTransferDomain = TaskType("transfer_domain") // Create a new external domain.
TaskTypeTradeDomain = TaskType("trade_domain") TaskTypeCreateExternalDomain = TaskType("create_external_domain")
TaskTypeLockDomainTransfer = TaskType("lock_domain_transfer") // Renew a domain.
TaskTypeUnlockDomainTransfer = TaskType("unlock_domain_transfer") TaskTypeRenewDomain = TaskType("renew_domain")
TaskTypeEnableDnssec = TaskType("enable_dnssec") // Transfer a domain to Scaleway Domains and DNS.
TaskTypeDisableDnssec = TaskType("disable_dnssec") TaskTypeTransferDomain = TaskType("transfer_domain")
TaskTypeUpdateDomain = TaskType("update_domain") // Trade a domain to a new owner.
TaskTypeUpdateContact = TaskType("update_contact") TaskTypeTradeDomain = TaskType("trade_domain")
TaskTypeDeleteDomain = TaskType("delete_domain") // Lock the transfer of a domain for protection.
TaskTypeCancelTask = TaskType("cancel_task") TaskTypeLockDomainTransfer = TaskType("lock_domain_transfer")
// Unlock the transfer of a domain.
TaskTypeUnlockDomainTransfer = TaskType("unlock_domain_transfer")
// Enable DNSSEC for a domain.
TaskTypeEnableDnssec = TaskType("enable_dnssec")
// Disable DNSSEC for a domain.
TaskTypeDisableDnssec = TaskType("disable_dnssec")
// Update the domain's information.
TaskTypeUpdateDomain = TaskType("update_domain")
// Change the technical or administrative contact.
TaskTypeUpdateContact = TaskType("update_contact")
// Delete a domain and destroy its zone versions, zones, and SSL certificates.
TaskTypeDeleteDomain = TaskType("delete_domain")
// Cancel a task that has not yet started.
TaskTypeCancelTask = TaskType("cancel_task")
// Generate a new SSL certificate.
TaskTypeGenerateSslCertificate = TaskType("generate_ssl_certificate") TaskTypeGenerateSslCertificate = TaskType("generate_ssl_certificate")
TaskTypeRenewSslCertificate = TaskType("renew_ssl_certificate") // Renew an SSL certificate.
TaskTypeSendMessage = TaskType("send_message") TaskTypeRenewSslCertificate = TaskType("renew_ssl_certificate")
TaskTypeDeleteDomainExpired = TaskType("delete_domain_expired") // Send a message. For most cases, it will be followed by an email.
TaskTypeDeleteExternalDomain = TaskType("delete_external_domain") TaskTypeSendMessage = TaskType("send_message")
TaskTypeCreateHost = TaskType("create_host") // Delete a domain that has expired and not been restored for at least 3 months.
TaskTypeUpdateHost = TaskType("update_host") TaskTypeDeleteDomainExpired = TaskType("delete_domain_expired")
TaskTypeDeleteHost = TaskType("delete_host") // Delete a newly registered external domain that has not been validated after 48 hours or when the external domain fails to point to our name servers for more than 14 days.
TaskTypeDeleteExternalDomain = TaskType("delete_external_domain")
// Create domain's hostname with glue IPs.
TaskTypeCreateHost = TaskType("create_host")
// Update domain's hostname with glue IPs.
TaskTypeUpdateHost = TaskType("update_host")
// Delete domain's hostname.
TaskTypeDeleteHost = TaskType("delete_host")
) )
func (enum TaskType) String() string { func (enum TaskType) String() string {
@ -1983,10 +2151,10 @@ type UpdateDNSZoneRecordsRequest struct {
// Update records within a DNS zone that has default name servers and perform several actions on your records. // Update records within a DNS zone that has default name servers and perform several actions on your records.
// //
// Actions include: // Actions include:
// - add: allows you to add a new record or add a new IP to an existing A record, for example // - add: allows you to add a new record or add a new IP to an existing A record, for example
// - set: allows you to edit a record or edit an IP from an existing A record, for example // - set: allows you to edit a record or edit an IP from an existing A record, for example
// - delete: allows you to delete a record or delete an IP from an existing A record, for example // - delete: allows you to delete a record or delete an IP from an existing A record, for example
// - clear: allows you to delete all records from a DNS zone // - clear: allows you to delete all records from a DNS zone
// //
// All edits will be versioned. // All edits will be versioned.
func (s *API) UpdateDNSZoneRecords(req *UpdateDNSZoneRecordsRequest, opts ...scw.RequestOption) (*UpdateDNSZoneRecordsResponse, error) { func (s *API) UpdateDNSZoneRecords(req *UpdateDNSZoneRecordsRequest, opts ...scw.RequestOption) (*UpdateDNSZoneRecordsResponse, error) {
@ -2629,8 +2797,8 @@ type RegistrarAPIListTasksRequest struct {
} }
// ListTasks: list tasks. // ListTasks: list tasks.
// List all account tasks. // List all operations performed on the account.
// You can filter the list by domain name. // You can filter the list of tasks by domain name.
func (s *RegistrarAPI) ListTasks(req *RegistrarAPIListTasksRequest, opts ...scw.RequestOption) (*ListTasksResponse, error) { func (s *RegistrarAPI) ListTasks(req *RegistrarAPIListTasksRequest, opts ...scw.RequestOption) (*ListTasksResponse, error) {
var err error var err error
@ -2691,9 +2859,9 @@ type RegistrarAPIBuyDomainsRequest struct {
TechnicalContact *NewContact `json:"technical_contact,omitempty"` TechnicalContact *NewContact `json:"technical_contact,omitempty"`
} }
// BuyDomains: buy one or more domains. // BuyDomains: purchase domains.
// Request the registration of domain names. // Request the registration of domain names.
// You can provide an already existing domain's contact or a new contact. // You can provide a domain's already existing contact or a new contact.
func (s *RegistrarAPI) BuyDomains(req *RegistrarAPIBuyDomainsRequest, opts ...scw.RequestOption) (*OrderResponse, error) { func (s *RegistrarAPI) BuyDomains(req *RegistrarAPIBuyDomainsRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
var err error var err error
@ -2730,8 +2898,8 @@ type RegistrarAPIRenewDomainsRequest struct {
ForceLateRenewal *bool `json:"force_late_renewal"` ForceLateRenewal *bool `json:"force_late_renewal"`
} }
// RenewDomains: renew one or more domains. // RenewDomains: renew domains.
// Request the renewal of domain names. // Request the renewal of one or more domain names.
func (s *RegistrarAPI) RenewDomains(req *RegistrarAPIRenewDomainsRequest, opts ...scw.RequestOption) (*OrderResponse, error) { func (s *RegistrarAPI) RenewDomains(req *RegistrarAPIRenewDomainsRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
var err error var err error
@ -2780,7 +2948,7 @@ type RegistrarAPITransferInDomainRequest struct {
} }
// TransferInDomain: transfer a domain. // TransferInDomain: transfer a domain.
// Request the transfer from another registrar domain to Scaleway. // Request the transfer of a domain from another registrar to Scaleway Domains and DNS.
func (s *RegistrarAPI) TransferInDomain(req *RegistrarAPITransferInDomainRequest, opts ...scw.RequestOption) (*OrderResponse, error) { func (s *RegistrarAPI) TransferInDomain(req *RegistrarAPITransferInDomainRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
var err error var err error
@ -2821,11 +2989,11 @@ type RegistrarAPITradeDomainRequest struct {
NewOwnerContact *NewContact `json:"new_owner_contact,omitempty"` NewOwnerContact *NewContact `json:"new_owner_contact,omitempty"`
} }
// TradeDomain: trade a domain contact. // TradeDomain: trade a domain's contact.
// Request a trade for the contact owner.<br/> // Request to change a domain's contact owner.<br/>
// If an `organization_id` is given, the change is from the current Scaleway account to another Scaleway account.<br/> // If you specify the `organization_id` of the domain's new owner, the contact will change from the current owner's Scaleway account to the new owner's Scaleway account.<br/>
// If no contact is given, the first contact of the other Scaleway account is taken.<br/> // If the new owner's current contact information is not available, the first ever contact they have created for previous domains is taken into account to operate the change.<br/>
// If the other Scaleway account has no contact. An error occurs. // If the new owner has never created a contact to register domains before, an error message displays.
func (s *RegistrarAPI) TradeDomain(req *RegistrarAPITradeDomainRequest, opts ...scw.RequestOption) (*OrderResponse, error) { func (s *RegistrarAPI) TradeDomain(req *RegistrarAPITradeDomainRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
var err error var err error
@ -2941,9 +3109,9 @@ type RegistrarAPICheckContactsCompatibilityRequest struct {
TechnicalContact *NewContact `json:"technical_contact,omitempty"` TechnicalContact *NewContact `json:"technical_contact,omitempty"`
} }
// CheckContactsCompatibility: check if contacts are compatible against a domain or a tld. // CheckContactsCompatibility: check if contacts are compatible with a domain or a TLD.
// Check if contacts are compatible against a domain or a tld. // Check whether contacts are compatible with a domain or a TLD.
// If not, it will return the information requiring a correction. // If contacts are not compatible with either the domain or the TLD, the information that needs to be corrected is returned.
func (s *RegistrarAPI) CheckContactsCompatibility(req *RegistrarAPICheckContactsCompatibilityRequest, opts ...scw.RequestOption) (*CheckContactsCompatibilityResponse, error) { func (s *RegistrarAPI) CheckContactsCompatibility(req *RegistrarAPICheckContactsCompatibilityRequest, opts ...scw.RequestOption) (*CheckContactsCompatibilityResponse, error) {
var err error var err error
@ -2980,7 +3148,7 @@ type RegistrarAPIListContactsRequest struct {
} }
// ListContacts: list contacts. // ListContacts: list contacts.
// Return a list of contacts with their domains and roles. // Retrieve the list of contacts and their associated domains and roles.
// You can filter the list by domain name. // You can filter the list by domain name.
func (s *RegistrarAPI) ListContacts(req *RegistrarAPIListContactsRequest, opts ...scw.RequestOption) (*ListContactsResponse, error) { func (s *RegistrarAPI) ListContacts(req *RegistrarAPIListContactsRequest, opts ...scw.RequestOption) (*ListContactsResponse, error) {
var err error var err error
@ -3018,7 +3186,7 @@ type RegistrarAPIGetContactRequest struct {
} }
// GetContact: get a contact. // GetContact: get a contact.
// Return a contact details retrieved from the registrar using a given contact ID. // Retrieve a contact's details from the registrar using the given contact's ID.
func (s *RegistrarAPI) GetContact(req *RegistrarAPIGetContactRequest, opts ...scw.RequestOption) (*Contact, error) { func (s *RegistrarAPI) GetContact(req *RegistrarAPIGetContactRequest, opts ...scw.RequestOption) (*Contact, error) {
var err error var err error
@ -3084,7 +3252,7 @@ type RegistrarAPIUpdateContactRequest struct {
} }
// UpdateContact: update contact. // UpdateContact: update contact.
// You can edit the contact coordinates. // Edit the contact's information.
func (s *RegistrarAPI) UpdateContact(req *RegistrarAPIUpdateContactRequest, opts ...scw.RequestOption) (*Contact, error) { func (s *RegistrarAPI) UpdateContact(req *RegistrarAPIUpdateContactRequest, opts ...scw.RequestOption) (*Contact, error) {
var err error var err error
@ -3133,7 +3301,7 @@ type RegistrarAPIListDomainsRequest struct {
} }
// ListDomains: list domains. // ListDomains: list domains.
// Returns a list of domains owned by the user. // Retrieve the list of domains you own.
func (s *RegistrarAPI) ListDomains(req *RegistrarAPIListDomainsRequest, opts ...scw.RequestOption) (*ListDomainsResponse, error) { func (s *RegistrarAPI) ListDomains(req *RegistrarAPIListDomainsRequest, opts ...scw.RequestOption) (*ListDomainsResponse, error) {
var err error var err error
@ -3181,8 +3349,8 @@ type RegistrarAPIListRenewableDomainsRequest struct {
OrganizationID *string `json:"-"` OrganizationID *string `json:"-"`
} }
// ListRenewableDomains: list scaleway domains that can or not be renewed. // ListRenewableDomains: list domains that can be renewed.
// Returns a list of domains owned by the user with a renew status and if renewable, the maximum renew duration in years. // Retrieve the list of domains you own that can be renewed. You can also see the maximum renewal duration in years for your domains that are renewable.
func (s *RegistrarAPI) ListRenewableDomains(req *RegistrarAPIListRenewableDomainsRequest, opts ...scw.RequestOption) (*ListRenewableDomainsResponse, error) { func (s *RegistrarAPI) ListRenewableDomains(req *RegistrarAPIListRenewableDomainsRequest, opts ...scw.RequestOption) (*ListRenewableDomainsResponse, error) {
var err error var err error
@ -3219,7 +3387,7 @@ type RegistrarAPIGetDomainRequest struct {
} }
// GetDomain: get domain. // GetDomain: get domain.
// Returns a the domain with more informations. // Retrieve a specific domain and display the domain's information.
func (s *RegistrarAPI) GetDomain(req *RegistrarAPIGetDomainRequest, opts ...scw.RequestOption) (*Domain, error) { func (s *RegistrarAPI) GetDomain(req *RegistrarAPIGetDomainRequest, opts ...scw.RequestOption) (*Domain, error) {
var err error var err error
@ -3264,9 +3432,9 @@ type RegistrarAPIUpdateDomainRequest struct {
AdministrativeContact *NewContact `json:"administrative_contact,omitempty"` AdministrativeContact *NewContact `json:"administrative_contact,omitempty"`
} }
// UpdateDomain: update a domain. // UpdateDomain: update a domain's contacts.
// Update the domain contacts or create a new one.<br/> // Update contacts for a specific domain or create a new contact.<br/>
// If you add the same contact for multiple roles. Only one ID will be created and used for all of them. // If you add the same contact for multiple roles (owner, administrative, technical), only one ID will be created and used for all of the roles.
func (s *RegistrarAPI) UpdateDomain(req *RegistrarAPIUpdateDomainRequest, opts ...scw.RequestOption) (*Domain, error) { func (s *RegistrarAPI) UpdateDomain(req *RegistrarAPIUpdateDomainRequest, opts ...scw.RequestOption) (*Domain, error) {
var err error var err error
@ -3298,8 +3466,8 @@ type RegistrarAPILockDomainTransferRequest struct {
Domain string `json:"-"` Domain string `json:"-"`
} }
// LockDomainTransfer: lock domain transfer. // LockDomainTransfer: lock the transfer of a domain.
// Lock domain transfer. A locked domain transfer can't be transferred and the auth code can't be requested. // Lock the transfer of a domain. This means that the domain cannot be transferred and the authorization code cannot be requested to your current registrar.
func (s *RegistrarAPI) LockDomainTransfer(req *RegistrarAPILockDomainTransferRequest, opts ...scw.RequestOption) (*Domain, error) { func (s *RegistrarAPI) LockDomainTransfer(req *RegistrarAPILockDomainTransferRequest, opts ...scw.RequestOption) (*Domain, error) {
var err error var err error
@ -3331,8 +3499,8 @@ type RegistrarAPIUnlockDomainTransferRequest struct {
Domain string `json:"-"` Domain string `json:"-"`
} }
// UnlockDomainTransfer: unlock domain transfer. // UnlockDomainTransfer: unlock the transfer of a domain.
// Unlock domain transfer. An unlocked domain can be transferred and the auth code can be requested for this. // Unlock the transfer of a domain. This means that the domain can be transferred and the authorization code can be requested to your current registrar.
func (s *RegistrarAPI) UnlockDomainTransfer(req *RegistrarAPIUnlockDomainTransferRequest, opts ...scw.RequestOption) (*Domain, error) { func (s *RegistrarAPI) UnlockDomainTransfer(req *RegistrarAPIUnlockDomainTransferRequest, opts ...scw.RequestOption) (*Domain, error) {
var err error var err error
@ -3364,7 +3532,8 @@ type RegistrarAPIEnableDomainAutoRenewRequest struct {
Domain string `json:"-"` Domain string `json:"-"`
} }
// EnableDomainAutoRenew: enable domain auto renew. // EnableDomainAutoRenew: enable auto renew.
// Enable the `auto renew` feature for a domain. This means the domain will be automatically renewed before its expiry date.
func (s *RegistrarAPI) EnableDomainAutoRenew(req *RegistrarAPIEnableDomainAutoRenewRequest, opts ...scw.RequestOption) (*Domain, error) { func (s *RegistrarAPI) EnableDomainAutoRenew(req *RegistrarAPIEnableDomainAutoRenewRequest, opts ...scw.RequestOption) (*Domain, error) {
var err error var err error
@ -3396,7 +3565,8 @@ type RegistrarAPIDisableDomainAutoRenewRequest struct {
Domain string `json:"-"` Domain string `json:"-"`
} }
// DisableDomainAutoRenew: disable domain auto renew. // DisableDomainAutoRenew: disable auto renew.
// Disable the `auto renew` feature for a domain. This means the domain will not be renewed before its expiry date.
func (s *RegistrarAPI) DisableDomainAutoRenew(req *RegistrarAPIDisableDomainAutoRenewRequest, opts ...scw.RequestOption) (*Domain, error) { func (s *RegistrarAPI) DisableDomainAutoRenew(req *RegistrarAPIDisableDomainAutoRenewRequest, opts ...scw.RequestOption) (*Domain, error) {
var err error var err error
@ -3428,9 +3598,9 @@ type RegistrarAPIGetDomainAuthCodeRequest struct {
Domain string `json:"-"` Domain string `json:"-"`
} }
// GetDomainAuthCode: return domain auth code. // GetDomainAuthCode: get a domain's authorization code.
// If possible, return the auth code for an unlocked domain transfer, or an error if the domain is locked. // Retrieve the authorization code to tranfer an unlocked domain. The output returns an error if the domain is locked.
// Some TLD may have a different procedure to retrieve the auth code, in that case, the information is given in the message field. // Some TLDs may have a different procedure to retrieve the authorization code. In that case, the information displays in the message field.
func (s *RegistrarAPI) GetDomainAuthCode(req *RegistrarAPIGetDomainAuthCodeRequest, opts ...scw.RequestOption) (*GetDomainAuthCodeResponse, error) { func (s *RegistrarAPI) GetDomainAuthCode(req *RegistrarAPIGetDomainAuthCodeRequest, opts ...scw.RequestOption) (*GetDomainAuthCodeResponse, error) {
var err error var err error
@ -3461,24 +3631,6 @@ type RegistrarAPIEnableDomainDNSSECRequest struct {
// EnableDomainDNSSEC: update domain DNSSEC. // EnableDomainDNSSEC: update domain DNSSEC.
// If your domain has the default Scaleway NS and uses another registrar, you have to update the DS record manually. // If your domain has the default Scaleway NS and uses another registrar, you have to update the DS record manually.
// For the algorithm, here are the code numbers for each type:
// - 1: RSAMD5
// - 2: DIFFIE_HELLMAN
// - 3: DSA_SHA1
// - 5: RSA_SHA1
// - 6: DSA_NSEC3_SHA1
// - 7: RSASHA1_NSEC3_SHA1
// - 8: RSASHA256
// - 10: RSASHA512
// - 12: ECC_GOST
// - 13: ECDSAP256SHA256
// - 14: ECDSAP384SHA384
//
// And for the digest type:
// - 1: SHA_1
// - 2: SHA_256
// - 3: GOST_R_34_11_94
// - 4: SHA_384.
func (s *RegistrarAPI) EnableDomainDNSSEC(req *RegistrarAPIEnableDomainDNSSECRequest, opts ...scw.RequestOption) (*Domain, error) { func (s *RegistrarAPI) EnableDomainDNSSEC(req *RegistrarAPIEnableDomainDNSSECRequest, opts ...scw.RequestOption) (*Domain, error) {
var err error var err error
@ -3510,7 +3662,8 @@ type RegistrarAPIDisableDomainDNSSECRequest struct {
Domain string `json:"-"` Domain string `json:"-"`
} }
// DisableDomainDNSSEC: disable domain DNSSEC. // DisableDomainDNSSEC: disable a domain's DNSSEC.
// Disable DNSSEC for a domain.
func (s *RegistrarAPI) DisableDomainDNSSEC(req *RegistrarAPIDisableDomainDNSSECRequest, opts ...scw.RequestOption) (*Domain, error) { func (s *RegistrarAPI) DisableDomainDNSSEC(req *RegistrarAPIDisableDomainDNSSECRequest, opts ...scw.RequestOption) (*Domain, error) {
var err error var err error
@ -3548,9 +3701,9 @@ type RegistrarAPISearchAvailableDomainsRequest struct {
} }
// SearchAvailableDomains: search available domains. // SearchAvailableDomains: search available domains.
// Search a domain (or at maximum, 10 domains). // Search a domain or a maximum of 10 domains that are available.
// //
// If the TLD list is empty or not set the search returns the results from the most popular TLDs. // If the TLD list is empty or not set, the search returns the results from the most popular TLDs.
func (s *RegistrarAPI) SearchAvailableDomains(req *RegistrarAPISearchAvailableDomainsRequest, opts ...scw.RequestOption) (*SearchAvailableDomainsResponse, error) { func (s *RegistrarAPI) SearchAvailableDomains(req *RegistrarAPISearchAvailableDomainsRequest, opts ...scw.RequestOption) (*SearchAvailableDomainsResponse, error) {
var err error var err error
@ -3583,7 +3736,8 @@ type RegistrarAPICreateDomainHostRequest struct {
IPs []net.IP `json:"ips"` IPs []net.IP `json:"ips"`
} }
// CreateDomainHost: create domain hostname with glue IPs. // CreateDomainHost: create a hostname for a domain.
// Create a hostname for a domain with glue IPs.
func (s *RegistrarAPI) CreateDomainHost(req *RegistrarAPICreateDomainHostRequest, opts ...scw.RequestOption) (*Host, error) { func (s *RegistrarAPI) CreateDomainHost(req *RegistrarAPICreateDomainHostRequest, opts ...scw.RequestOption) (*Host, error) {
var err error var err error
@ -3619,7 +3773,8 @@ type RegistrarAPIListDomainHostsRequest struct {
PageSize *uint32 `json:"-"` PageSize *uint32 `json:"-"`
} }
// ListDomainHosts: list domain hostnames with they glue IPs. // ListDomainHosts: list a domain's hostnames.
// List a domain's hostnames using their glue IPs.
func (s *RegistrarAPI) ListDomainHosts(req *RegistrarAPIListDomainHostsRequest, opts ...scw.RequestOption) (*ListDomainHostsResponse, error) { func (s *RegistrarAPI) ListDomainHosts(req *RegistrarAPIListDomainHostsRequest, opts ...scw.RequestOption) (*ListDomainHostsResponse, error) {
var err error var err error
@ -3660,7 +3815,8 @@ type RegistrarAPIUpdateDomainHostRequest struct {
IPs *[]string `json:"ips"` IPs *[]string `json:"ips"`
} }
// UpdateDomainHost: update domain hostname with glue IPs. // UpdateDomainHost: update a domain's hostname.
// Update a domain's hostname with glue IPs.
func (s *RegistrarAPI) UpdateDomainHost(req *RegistrarAPIUpdateDomainHostRequest, opts ...scw.RequestOption) (*Host, error) { func (s *RegistrarAPI) UpdateDomainHost(req *RegistrarAPIUpdateDomainHostRequest, opts ...scw.RequestOption) (*Host, error) {
var err error var err error
@ -3698,7 +3854,7 @@ type RegistrarAPIDeleteDomainHostRequest struct {
Name string `json:"-"` Name string `json:"-"`
} }
// DeleteDomainHost: delete domain hostname. // DeleteDomainHost: delete a domain's hostname.
func (s *RegistrarAPI) DeleteDomainHost(req *RegistrarAPIDeleteDomainHostRequest, opts ...scw.RequestOption) (*Host, error) { func (s *RegistrarAPI) DeleteDomainHost(req *RegistrarAPIDeleteDomainHostRequest, opts ...scw.RequestOption) (*Host, error) {
var err error var err error

View File

@ -54,9 +54,12 @@ func NewAPI(client *scw.Client) *API {
type BearerType string type BearerType string
const ( const (
// Unknown bearer type
BearerTypeUnknownBearerType = BearerType("unknown_bearer_type") BearerTypeUnknownBearerType = BearerType("unknown_bearer_type")
BearerTypeUser = BearerType("user") // User
BearerTypeApplication = BearerType("application") BearerTypeUser = BearerType("user")
// Application
BearerTypeApplication = BearerType("application")
) )
func (enum BearerType) String() string { func (enum BearerType) String() string {
@ -85,13 +88,21 @@ func (enum *BearerType) UnmarshalJSON(data []byte) error {
type ListAPIKeysRequestOrderBy string type ListAPIKeysRequestOrderBy string
const ( const (
ListAPIKeysRequestOrderByCreatedAtAsc = ListAPIKeysRequestOrderBy("created_at_asc") // Creation date ascending
ListAPIKeysRequestOrderByCreatedAtAsc = ListAPIKeysRequestOrderBy("created_at_asc")
// Creation date descending
ListAPIKeysRequestOrderByCreatedAtDesc = ListAPIKeysRequestOrderBy("created_at_desc") ListAPIKeysRequestOrderByCreatedAtDesc = ListAPIKeysRequestOrderBy("created_at_desc")
ListAPIKeysRequestOrderByUpdatedAtAsc = ListAPIKeysRequestOrderBy("updated_at_asc") // Update date ascending
ListAPIKeysRequestOrderByUpdatedAtAsc = ListAPIKeysRequestOrderBy("updated_at_asc")
// Update date descending
ListAPIKeysRequestOrderByUpdatedAtDesc = ListAPIKeysRequestOrderBy("updated_at_desc") ListAPIKeysRequestOrderByUpdatedAtDesc = ListAPIKeysRequestOrderBy("updated_at_desc")
ListAPIKeysRequestOrderByExpiresAtAsc = ListAPIKeysRequestOrderBy("expires_at_asc") // Expiration date ascending
ListAPIKeysRequestOrderByExpiresAtAsc = ListAPIKeysRequestOrderBy("expires_at_asc")
// Expiration date descending
ListAPIKeysRequestOrderByExpiresAtDesc = ListAPIKeysRequestOrderBy("expires_at_desc") ListAPIKeysRequestOrderByExpiresAtDesc = ListAPIKeysRequestOrderBy("expires_at_desc")
ListAPIKeysRequestOrderByAccessKeyAsc = ListAPIKeysRequestOrderBy("access_key_asc") // Access key ascending
ListAPIKeysRequestOrderByAccessKeyAsc = ListAPIKeysRequestOrderBy("access_key_asc")
// Access key descending
ListAPIKeysRequestOrderByAccessKeyDesc = ListAPIKeysRequestOrderBy("access_key_desc") ListAPIKeysRequestOrderByAccessKeyDesc = ListAPIKeysRequestOrderBy("access_key_desc")
) )
@ -121,12 +132,18 @@ func (enum *ListAPIKeysRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListApplicationsRequestOrderBy string type ListApplicationsRequestOrderBy string
const ( const (
ListApplicationsRequestOrderByCreatedAtAsc = ListApplicationsRequestOrderBy("created_at_asc") // Creation date ascending
ListApplicationsRequestOrderByCreatedAtAsc = ListApplicationsRequestOrderBy("created_at_asc")
// Creation date descending
ListApplicationsRequestOrderByCreatedAtDesc = ListApplicationsRequestOrderBy("created_at_desc") ListApplicationsRequestOrderByCreatedAtDesc = ListApplicationsRequestOrderBy("created_at_desc")
ListApplicationsRequestOrderByUpdatedAtAsc = ListApplicationsRequestOrderBy("updated_at_asc") // Update date ascending
ListApplicationsRequestOrderByUpdatedAtAsc = ListApplicationsRequestOrderBy("updated_at_asc")
// Update date descending
ListApplicationsRequestOrderByUpdatedAtDesc = ListApplicationsRequestOrderBy("updated_at_desc") ListApplicationsRequestOrderByUpdatedAtDesc = ListApplicationsRequestOrderBy("updated_at_desc")
ListApplicationsRequestOrderByNameAsc = ListApplicationsRequestOrderBy("name_asc") // Name ascending
ListApplicationsRequestOrderByNameDesc = ListApplicationsRequestOrderBy("name_desc") ListApplicationsRequestOrderByNameAsc = ListApplicationsRequestOrderBy("name_asc")
// Name descending
ListApplicationsRequestOrderByNameDesc = ListApplicationsRequestOrderBy("name_desc")
) )
func (enum ListApplicationsRequestOrderBy) String() string { func (enum ListApplicationsRequestOrderBy) String() string {
@ -155,12 +172,18 @@ func (enum *ListApplicationsRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListGroupsRequestOrderBy string type ListGroupsRequestOrderBy string
const ( const (
ListGroupsRequestOrderByCreatedAtAsc = ListGroupsRequestOrderBy("created_at_asc") // Creation date ascending
ListGroupsRequestOrderByCreatedAtAsc = ListGroupsRequestOrderBy("created_at_asc")
// Creation date descending
ListGroupsRequestOrderByCreatedAtDesc = ListGroupsRequestOrderBy("created_at_desc") ListGroupsRequestOrderByCreatedAtDesc = ListGroupsRequestOrderBy("created_at_desc")
ListGroupsRequestOrderByUpdatedAtAsc = ListGroupsRequestOrderBy("updated_at_asc") // Update date ascending
ListGroupsRequestOrderByUpdatedAtAsc = ListGroupsRequestOrderBy("updated_at_asc")
// Update date descending
ListGroupsRequestOrderByUpdatedAtDesc = ListGroupsRequestOrderBy("updated_at_desc") ListGroupsRequestOrderByUpdatedAtDesc = ListGroupsRequestOrderBy("updated_at_desc")
ListGroupsRequestOrderByNameAsc = ListGroupsRequestOrderBy("name_asc") // Name ascending
ListGroupsRequestOrderByNameDesc = ListGroupsRequestOrderBy("name_desc") ListGroupsRequestOrderByNameAsc = ListGroupsRequestOrderBy("name_asc")
// Name descending
ListGroupsRequestOrderByNameDesc = ListGroupsRequestOrderBy("name_desc")
) )
func (enum ListGroupsRequestOrderBy) String() string { func (enum ListGroupsRequestOrderBy) String() string {
@ -189,9 +212,13 @@ func (enum *ListGroupsRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListJWTsRequestOrderBy string type ListJWTsRequestOrderBy string
const ( const (
ListJWTsRequestOrderByCreatedAtAsc = ListJWTsRequestOrderBy("created_at_asc") // Creation date ascending
ListJWTsRequestOrderByCreatedAtAsc = ListJWTsRequestOrderBy("created_at_asc")
// Creation date descending
ListJWTsRequestOrderByCreatedAtDesc = ListJWTsRequestOrderBy("created_at_desc") ListJWTsRequestOrderByCreatedAtDesc = ListJWTsRequestOrderBy("created_at_desc")
ListJWTsRequestOrderByUpdatedAtAsc = ListJWTsRequestOrderBy("updated_at_asc") // Update date ascending
ListJWTsRequestOrderByUpdatedAtAsc = ListJWTsRequestOrderBy("updated_at_asc")
// Update date descending
ListJWTsRequestOrderByUpdatedAtDesc = ListJWTsRequestOrderBy("updated_at_desc") ListJWTsRequestOrderByUpdatedAtDesc = ListJWTsRequestOrderBy("updated_at_desc")
) )
@ -221,9 +248,13 @@ func (enum *ListJWTsRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListPermissionSetsRequestOrderBy string type ListPermissionSetsRequestOrderBy string
const ( const (
ListPermissionSetsRequestOrderByNameAsc = ListPermissionSetsRequestOrderBy("name_asc") // Name ascending
ListPermissionSetsRequestOrderByNameDesc = ListPermissionSetsRequestOrderBy("name_desc") ListPermissionSetsRequestOrderByNameAsc = ListPermissionSetsRequestOrderBy("name_asc")
ListPermissionSetsRequestOrderByCreatedAtAsc = ListPermissionSetsRequestOrderBy("created_at_asc") // Name descending
ListPermissionSetsRequestOrderByNameDesc = ListPermissionSetsRequestOrderBy("name_desc")
// Creation date ascending
ListPermissionSetsRequestOrderByCreatedAtAsc = ListPermissionSetsRequestOrderBy("created_at_asc")
// Creation date descending
ListPermissionSetsRequestOrderByCreatedAtDesc = ListPermissionSetsRequestOrderBy("created_at_desc") ListPermissionSetsRequestOrderByCreatedAtDesc = ListPermissionSetsRequestOrderBy("created_at_desc")
) )
@ -253,10 +284,14 @@ func (enum *ListPermissionSetsRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListPoliciesRequestOrderBy string type ListPoliciesRequestOrderBy string
const ( const (
ListPoliciesRequestOrderByPolicyNameAsc = ListPoliciesRequestOrderBy("policy_name_asc") // Policy name ascending
ListPoliciesRequestOrderByPolicyNameAsc = ListPoliciesRequestOrderBy("policy_name_asc")
// Policy name descending
ListPoliciesRequestOrderByPolicyNameDesc = ListPoliciesRequestOrderBy("policy_name_desc") ListPoliciesRequestOrderByPolicyNameDesc = ListPoliciesRequestOrderBy("policy_name_desc")
ListPoliciesRequestOrderByCreatedAtAsc = ListPoliciesRequestOrderBy("created_at_asc") // Creation date ascending
ListPoliciesRequestOrderByCreatedAtDesc = ListPoliciesRequestOrderBy("created_at_desc") ListPoliciesRequestOrderByCreatedAtAsc = ListPoliciesRequestOrderBy("created_at_asc")
// Creation date descending
ListPoliciesRequestOrderByCreatedAtDesc = ListPoliciesRequestOrderBy("created_at_desc")
) )
func (enum ListPoliciesRequestOrderBy) String() string { func (enum ListPoliciesRequestOrderBy) String() string {
@ -285,7 +320,9 @@ func (enum *ListPoliciesRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListQuotaRequestOrderBy string type ListQuotaRequestOrderBy string
const ( const (
ListQuotaRequestOrderByNameAsc = ListQuotaRequestOrderBy("name_asc") // Name ascending
ListQuotaRequestOrderByNameAsc = ListQuotaRequestOrderBy("name_asc")
// Name descending
ListQuotaRequestOrderByNameDesc = ListQuotaRequestOrderBy("name_desc") ListQuotaRequestOrderByNameDesc = ListQuotaRequestOrderBy("name_desc")
) )
@ -315,12 +352,18 @@ func (enum *ListQuotaRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListSSHKeysRequestOrderBy string type ListSSHKeysRequestOrderBy string
const ( const (
ListSSHKeysRequestOrderByCreatedAtAsc = ListSSHKeysRequestOrderBy("created_at_asc") // Creation date ascending
ListSSHKeysRequestOrderByCreatedAtAsc = ListSSHKeysRequestOrderBy("created_at_asc")
// Creation date descending
ListSSHKeysRequestOrderByCreatedAtDesc = ListSSHKeysRequestOrderBy("created_at_desc") ListSSHKeysRequestOrderByCreatedAtDesc = ListSSHKeysRequestOrderBy("created_at_desc")
ListSSHKeysRequestOrderByUpdatedAtAsc = ListSSHKeysRequestOrderBy("updated_at_asc") // Update date ascending
ListSSHKeysRequestOrderByUpdatedAtAsc = ListSSHKeysRequestOrderBy("updated_at_asc")
// Update date descending
ListSSHKeysRequestOrderByUpdatedAtDesc = ListSSHKeysRequestOrderBy("updated_at_desc") ListSSHKeysRequestOrderByUpdatedAtDesc = ListSSHKeysRequestOrderBy("updated_at_desc")
ListSSHKeysRequestOrderByNameAsc = ListSSHKeysRequestOrderBy("name_asc") // Name ascending
ListSSHKeysRequestOrderByNameDesc = ListSSHKeysRequestOrderBy("name_desc") ListSSHKeysRequestOrderByNameAsc = ListSSHKeysRequestOrderBy("name_asc")
// Name descending
ListSSHKeysRequestOrderByNameDesc = ListSSHKeysRequestOrderBy("name_desc")
) )
func (enum ListSSHKeysRequestOrderBy) String() string { func (enum ListSSHKeysRequestOrderBy) String() string {
@ -349,13 +392,21 @@ func (enum *ListSSHKeysRequestOrderBy) UnmarshalJSON(data []byte) error {
type ListUsersRequestOrderBy string type ListUsersRequestOrderBy string
const ( const (
ListUsersRequestOrderByCreatedAtAsc = ListUsersRequestOrderBy("created_at_asc") // Creation date ascending
ListUsersRequestOrderByCreatedAtAsc = ListUsersRequestOrderBy("created_at_asc")
// Creation date descending
ListUsersRequestOrderByCreatedAtDesc = ListUsersRequestOrderBy("created_at_desc") ListUsersRequestOrderByCreatedAtDesc = ListUsersRequestOrderBy("created_at_desc")
ListUsersRequestOrderByUpdatedAtAsc = ListUsersRequestOrderBy("updated_at_asc") // Update date ascending
ListUsersRequestOrderByUpdatedAtAsc = ListUsersRequestOrderBy("updated_at_asc")
// Update date descending
ListUsersRequestOrderByUpdatedAtDesc = ListUsersRequestOrderBy("updated_at_desc") ListUsersRequestOrderByUpdatedAtDesc = ListUsersRequestOrderBy("updated_at_desc")
ListUsersRequestOrderByEmailAsc = ListUsersRequestOrderBy("email_asc") // Email ascending
ListUsersRequestOrderByEmailDesc = ListUsersRequestOrderBy("email_desc") ListUsersRequestOrderByEmailAsc = ListUsersRequestOrderBy("email_asc")
ListUsersRequestOrderByLastLoginAsc = ListUsersRequestOrderBy("last_login_asc") // Email descending
ListUsersRequestOrderByEmailDesc = ListUsersRequestOrderBy("email_desc")
// Last login ascending
ListUsersRequestOrderByLastLoginAsc = ListUsersRequestOrderBy("last_login_asc")
// Last login descending
ListUsersRequestOrderByLastLoginDesc = ListUsersRequestOrderBy("last_login_desc") ListUsersRequestOrderByLastLoginDesc = ListUsersRequestOrderBy("last_login_desc")
) )
@ -385,10 +436,14 @@ func (enum *ListUsersRequestOrderBy) UnmarshalJSON(data []byte) error {
type PermissionSetScopeType string type PermissionSetScopeType string
const ( const (
// Unknown scope type
PermissionSetScopeTypeUnknownScopeType = PermissionSetScopeType("unknown_scope_type") PermissionSetScopeTypeUnknownScopeType = PermissionSetScopeType("unknown_scope_type")
PermissionSetScopeTypeProjects = PermissionSetScopeType("projects") // Projects
PermissionSetScopeTypeOrganization = PermissionSetScopeType("organization") PermissionSetScopeTypeProjects = PermissionSetScopeType("projects")
PermissionSetScopeTypeAccountRootUser = PermissionSetScopeType("account_root_user") // Organization
PermissionSetScopeTypeOrganization = PermissionSetScopeType("organization")
// Account root user
PermissionSetScopeTypeAccountRootUser = PermissionSetScopeType("account_root_user")
) )
func (enum PermissionSetScopeType) String() string { func (enum PermissionSetScopeType) String() string {
@ -417,9 +472,12 @@ func (enum *PermissionSetScopeType) UnmarshalJSON(data []byte) error {
type UserStatus string type UserStatus string
const ( const (
UserStatusUnknownStatus = UserStatus("unknown_status") // Unknown status
UserStatusUnknownStatus = UserStatus("unknown_status")
// Invitation pending
UserStatusInvitationPending = UserStatus("invitation_pending") UserStatusInvitationPending = UserStatus("invitation_pending")
UserStatusActivated = UserStatus("activated") // Activated
UserStatusActivated = UserStatus("activated")
) )
func (enum UserStatus) String() string { func (enum UserStatus) String() string {
@ -448,9 +506,12 @@ func (enum *UserStatus) UnmarshalJSON(data []byte) error {
type UserType string type UserType string
const ( const (
// Unknown type
UserTypeUnknownType = UserType("unknown_type") UserTypeUnknownType = UserType("unknown_type")
UserTypeGuest = UserType("guest") // Guest
UserTypeOwner = UserType("owner") UserTypeGuest = UserType("guest")
// Owner
UserTypeOwner = UserType("owner")
) )
func (enum UserType) String() string { func (enum UserType) String() string {

View File

@ -112,6 +112,71 @@ func (enum *BootType) UnmarshalJSON(data []byte) error {
return nil return nil
} }
type IPState string
const (
IPStateUnknownState = IPState("unknown_state")
IPStateDetached = IPState("detached")
IPStateAttached = IPState("attached")
IPStatePending = IPState("pending")
IPStateError = IPState("error")
)
func (enum IPState) String() string {
if enum == "" {
// return default value if empty
return "unknown_state"
}
return string(enum)
}
func (enum IPState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *IPState) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = IPState(IPState(tmp).String())
return nil
}
type IPType string
const (
IPTypeUnknownIptype = IPType("unknown_iptype")
IPTypeNat = IPType("nat")
IPTypeRoutedIPv4 = IPType("routed_ipv4")
IPTypeRoutedIPv6 = IPType("routed_ipv6")
)
func (enum IPType) String() string {
if enum == "" {
// return default value if empty
return "unknown_iptype"
}
return string(enum)
}
func (enum IPType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *IPType) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = IPType(IPType(tmp).String())
return nil
}
type ImageState string type ImageState string
const ( const (
@ -453,6 +518,67 @@ func (enum *ServerAction) UnmarshalJSON(data []byte) error {
return nil return nil
} }
type ServerIPIPFamily string
const (
ServerIPIPFamilyInet = ServerIPIPFamily("inet")
ServerIPIPFamilyInet6 = ServerIPIPFamily("inet6")
)
func (enum ServerIPIPFamily) String() string {
if enum == "" {
// return default value if empty
return "inet"
}
return string(enum)
}
func (enum ServerIPIPFamily) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *ServerIPIPFamily) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = ServerIPIPFamily(ServerIPIPFamily(tmp).String())
return nil
}
type ServerIPProvisioningMode string
const (
ServerIPProvisioningModeManual = ServerIPProvisioningMode("manual")
ServerIPProvisioningModeDHCP = ServerIPProvisioningMode("dhcp")
ServerIPProvisioningModeSlaac = ServerIPProvisioningMode("slaac")
)
func (enum ServerIPProvisioningMode) String() string {
if enum == "" {
// return default value if empty
return "manual"
}
return string(enum)
}
func (enum ServerIPProvisioningMode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
func (enum *ServerIPProvisioningMode) UnmarshalJSON(data []byte) error {
tmp := ""
if err := json.Unmarshal(data, &tmp); err != nil {
return err
}
*enum = ServerIPProvisioningMode(ServerIPProvisioningMode(tmp).String())
return nil
}
type ServerState string type ServerState string
const ( const (
@ -893,8 +1019,12 @@ type GetServerResponse struct {
Server *Server `json:"server"` Server *Server `json:"server"`
} }
// GetServerTypesAvailabilityResponse: get server types availability response.
type GetServerTypesAvailabilityResponse struct { type GetServerTypesAvailabilityResponse struct {
// Servers: map of server types.
Servers map[string]*GetServerTypesAvailabilityResponseAvailability `json:"servers"` Servers map[string]*GetServerTypesAvailabilityResponseAvailability `json:"servers"`
TotalCount uint32 `json:"total_count"`
} }
type GetServerTypesAvailabilityResponseAvailability struct { type GetServerTypesAvailabilityResponseAvailability struct {
@ -924,6 +1054,12 @@ type IP struct {
Tags []string `json:"tags"` Tags []string `json:"tags"`
Project string `json:"project"` Project string `json:"project"`
// Type: default value: unknown_iptype
Type IPType `json:"type"`
// State: default value: unknown_state
State IPState `json:"state"`
Prefix scw.IPNet `json:"prefix"`
Zone scw.Zone `json:"zone"` Zone scw.Zone `json:"zone"`
} }
@ -1212,8 +1348,10 @@ type Server struct {
CommercialType string `json:"commercial_type"` CommercialType string `json:"commercial_type"`
// CreationDate: instance creation date. // CreationDate: instance creation date.
CreationDate *time.Time `json:"creation_date"` CreationDate *time.Time `json:"creation_date"`
// DynamicIPRequired: true if a dynamic IP is required. // DynamicIPRequired: true if a dynamic IPv4 is required.
DynamicIPRequired bool `json:"dynamic_ip_required"` DynamicIPRequired bool `json:"dynamic_ip_required"`
// RoutedIPEnabled: true to configure the instance so it uses the new routed IP mode.
RoutedIPEnabled bool `json:"routed_ip_enabled"`
// EnableIPv6: true if IPv6 is enabled. // EnableIPv6: true if IPv6 is enabled.
EnableIPv6 bool `json:"enable_ipv6"` EnableIPv6 bool `json:"enable_ipv6"`
// Hostname: instance host name. // Hostname: instance host name.
@ -1226,6 +1364,10 @@ type Server struct {
PrivateIP *string `json:"private_ip"` PrivateIP *string `json:"private_ip"`
// PublicIP: information about the public IP. // PublicIP: information about the public IP.
PublicIP *ServerIP `json:"public_ip"` PublicIP *ServerIP `json:"public_ip"`
// PublicIPs: information about all the public IPs attached to the server.
PublicIPs []*ServerIP `json:"public_ips"`
// MacAddress: the server's MAC address.
MacAddress string `json:"mac_address"`
// ModificationDate: instance modification date. // ModificationDate: instance modification date.
ModificationDate *time.Time `json:"modification_date"` ModificationDate *time.Time `json:"modification_date"`
// State: instance state. // State: instance state.
@ -1275,11 +1417,21 @@ type ServerActionResponse struct {
// ServerIP: server. ip. // ServerIP: server. ip.
type ServerIP struct { type ServerIP struct {
// ID: unique ID of the IP address. // ID: unique ID of the IP address.
ID string `json:"id"` ID string `json:"id,omitempty"`
// Address: instance public IPv4 IP-Address. // Address: instance's public IP-Address.
Address net.IP `json:"address"` Address net.IP `json:"address,omitempty"`
// Gateway: gateway's IP address.
Gateway net.IP `json:"gateway,omitempty"`
// Netmask: cIDR netmask.
Netmask string `json:"netmask,omitempty"`
// Family: IP address family (inet or inet6).
// Default value: inet
Family ServerIPIPFamily `json:"family,omitempty"`
// Dynamic: true if the IP address is dynamic. // Dynamic: true if the IP address is dynamic.
Dynamic bool `json:"dynamic"` Dynamic bool `json:"dynamic,omitempty"`
// ProvisioningMode: information about this address provisioning mode.
// Default value: manual
ProvisioningMode ServerIPProvisioningMode `json:"provisioning_mode,omitempty"`
} }
// ServerIPv6: server. ipv6. // ServerIPv6: server. ipv6.
@ -1574,23 +1726,23 @@ type VolumeServer struct {
// VolumeServerTemplate: volume server template. // VolumeServerTemplate: volume server template.
type VolumeServerTemplate struct { type VolumeServerTemplate struct {
// ID: UUID of the volume. // ID: UUID of the volume.
ID string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
// Boot: force the Instance to boot on this volume. // Boot: force the Instance to boot on this volume.
// Default value: false // Default value: false
Boot bool `json:"boot,omitempty"` Boot *bool `json:"boot,omitempty"`
// Name: name of the volume. // Name: name of the volume.
Name string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
// Size: disk size of the volume, must be a multiple of 512. // Size: disk size of the volume, must be a multiple of 512.
Size scw.Size `json:"size,omitempty"` Size *scw.Size `json:"size,omitempty"`
// VolumeType: type of the volume. // VolumeType: type of the volume.
// Default value: l_ssd // Default value: l_ssd
VolumeType VolumeVolumeType `json:"volume_type,omitempty"` VolumeType VolumeVolumeType `json:"volume_type,omitempty"`
// BaseSnapshot: ID of the snapshot on which this volume will be based. // BaseSnapshot: ID of the snapshot on which this volume will be based.
BaseSnapshot string `json:"base_snapshot,omitempty"` BaseSnapshot *string `json:"base_snapshot,omitempty"`
// Organization: organization ID of the volume. // Organization: organization ID of the volume.
Organization string `json:"organization,omitempty"` Organization *string `json:"organization,omitempty"`
// Project: project ID of the volume. // Project: project ID of the volume.
Project string `json:"project,omitempty"` Project *string `json:"project,omitempty"`
} }
type VolumeSummary struct { type VolumeSummary struct {
@ -1669,15 +1821,16 @@ type setSnapshotResponse struct {
// Zones list localities the api is available in // Zones list localities the api is available in
func (s *API) Zones() []scw.Zone { func (s *API) Zones() []scw.Zone {
return []scw.Zone{scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2} return []scw.Zone{scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneFrPar3, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2}
} }
type GetServerTypesAvailabilityRequest struct { type GetServerTypesAvailabilityRequest struct {
// Zone: zone to target. If none is passed will use default zone from the config. // Zone: zone to target. If none is passed will use default zone from the config.
Zone scw.Zone `json:"-"` Zone scw.Zone `json:"-"`
// PerPage: a positive integer lower or equal to 100 to select the number of items to return.
// Default value: 50
PerPage *uint32 `json:"-"` PerPage *uint32 `json:"-"`
// Page: a positive integer to choose the page to return.
Page *int32 `json:"-"` Page *int32 `json:"-"`
} }
@ -1904,8 +2057,10 @@ type CreateServerRequest struct {
Zone scw.Zone `json:"-"` Zone scw.Zone `json:"-"`
// Name: instance name. // Name: instance name.
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
// DynamicIPRequired: define if a dynamic IP is required for the Instance. // DynamicIPRequired: define if a dynamic IPv4 is required for the Instance.
DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"` DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"`
// RoutedIPEnabled: if true, configure the Instance so it uses the new routed IP mode.
RoutedIPEnabled *bool `json:"routed_ip_enabled,omitempty"`
// CommercialType: define the Instance commercial type (i.e. GP1-S). // CommercialType: define the Instance commercial type (i.e. GP1-S).
CommercialType string `json:"commercial_type,omitempty"` CommercialType string `json:"commercial_type,omitempty"`
// Image: instance image ID or label. // Image: instance image ID or label.
@ -1914,8 +2069,10 @@ type CreateServerRequest struct {
Volumes map[string]*VolumeServerTemplate `json:"volumes,omitempty"` Volumes map[string]*VolumeServerTemplate `json:"volumes,omitempty"`
// EnableIPv6: true if IPv6 is enabled on the server. // EnableIPv6: true if IPv6 is enabled on the server.
EnableIPv6 bool `json:"enable_ipv6,omitempty"` EnableIPv6 bool `json:"enable_ipv6,omitempty"`
// PublicIP: ID of the reserved IP to attach to the server. // PublicIP: ID of the reserved IP to attach to the Instance.
PublicIP *string `json:"public_ip,omitempty"` PublicIP *string `json:"public_ip,omitempty"`
// PublicIPs: a list of reserved IP IDs to attach to the Instance.
PublicIPs []*string `json:"public_ips,omitempty"`
// BootType: boot type to use. // BootType: boot type to use.
// Default value: local // Default value: local
BootType *BootType `json:"boot_type,omitempty"` BootType *BootType `json:"boot_type,omitempty"`
@ -2081,8 +2238,10 @@ type setServerRequest struct {
CommercialType string `json:"commercial_type"` CommercialType string `json:"commercial_type"`
// CreationDate: instance creation date. // CreationDate: instance creation date.
CreationDate *time.Time `json:"creation_date"` CreationDate *time.Time `json:"creation_date"`
// DynamicIPRequired: true if a dynamic IP is required. // DynamicIPRequired: true if a dynamic IPv4 is required.
DynamicIPRequired bool `json:"dynamic_ip_required"` DynamicIPRequired bool `json:"dynamic_ip_required"`
// RoutedIPEnabled: true to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False).
RoutedIPEnabled *bool `json:"routed_ip_enabled"`
// EnableIPv6: true if IPv6 is enabled. // EnableIPv6: true if IPv6 is enabled.
EnableIPv6 bool `json:"enable_ipv6"` EnableIPv6 bool `json:"enable_ipv6"`
// Hostname: instance host name. // Hostname: instance host name.
@ -2095,6 +2254,8 @@ type setServerRequest struct {
PrivateIP *string `json:"private_ip"` PrivateIP *string `json:"private_ip"`
// PublicIP: information about the public IP. // PublicIP: information about the public IP.
PublicIP *ServerIP `json:"public_ip"` PublicIP *ServerIP `json:"public_ip"`
// PublicIPs: information about all the public IPs attached to the server.
PublicIPs []*ServerIP `json:"public_ips"`
// ModificationDate: instance modification date. // ModificationDate: instance modification date.
ModificationDate *time.Time `json:"modification_date"` ModificationDate *time.Time `json:"modification_date"`
// State: instance state. // State: instance state.
@ -2189,6 +2350,10 @@ type UpdateServerRequest struct {
Bootscript *string `json:"bootscript,omitempty"` Bootscript *string `json:"bootscript,omitempty"`
DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"` DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"`
// RoutedIPEnabled: true to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False).
RoutedIPEnabled *bool `json:"routed_ip_enabled,omitempty"`
PublicIPs []*ServerIP `json:"public_ips,omitempty"`
EnableIPv6 *bool `json:"enable_ipv6,omitempty"` EnableIPv6 *bool `json:"enable_ipv6,omitempty"`
@ -2199,6 +2364,12 @@ type UpdateServerRequest struct {
PlacementGroup *NullableStringValue `json:"placement_group,omitempty"` PlacementGroup *NullableStringValue `json:"placement_group,omitempty"`
// PrivateNics: instance private NICs. // PrivateNics: instance private NICs.
PrivateNics []*PrivateNIC `json:"private_nics,omitempty"` PrivateNics []*PrivateNIC `json:"private_nics,omitempty"`
// CommercialType: set the commercial_type for this Instance.
// Warning: This field has some restrictions:
// - Cannot be changed if the Instance is not in `stopped` state.
// - Cannot be changed if the Instance is in a placement group.
// - Local storage requirements of the target commercial_types must be fulfilled (i.e. if an Instance has 80GB of local storage, it can be changed into a GP1-XS, which has a maximum of 150GB, but it cannot be changed into a DEV1-S, which has only 20GB).
CommercialType *string `json:"commercial_type,omitempty"`
} }
// updateServer: update an Instance. // updateServer: update an Instance.
@ -2306,6 +2477,7 @@ type ServerActionRequest struct {
// * `reboot`: Stop the instance and restart it. // * `reboot`: Stop the instance and restart it.
// * `backup`: Create an image with all the volumes of an Instance. // * `backup`: Create an image with all the volumes of an Instance.
// * `terminate`: Delete the Instance along with all attached volumes. // * `terminate`: Delete the Instance along with all attached volumes.
// * `enable_routed_ip`: Migrate the Instance to the new network stack.
// //
// Keep in mind that terminating an Instance will result in the deletion of all attached volumes, including local and block storage. // Keep in mind that terminating an Instance will result in the deletion of all attached volumes, including local and block storage.
// If you want to preserve your local volumes, you should use the `archive` action instead of `terminate`. Similarly, if you want to keep your block storage volumes, you must first detach them before issuing the `terminate` command. // If you want to preserve your local volumes, you should use the `archive` action instead of `terminate`. Similarly, if you want to keep your block storage volumes, you must first detach them before issuing the `terminate` command.
@ -4550,6 +4722,9 @@ type CreateIPRequest struct {
Tags []string `json:"tags,omitempty"` Tags []string `json:"tags,omitempty"`
// Server: UUID of the Instance you want to attach the IP to. // Server: UUID of the Instance you want to attach the IP to.
Server *string `json:"server,omitempty"` Server *string `json:"server,omitempty"`
// Type: IP type to reserve (either 'nat', 'routed_ipv4' or 'routed_ipv6').
// Default value: unknown_iptype
Type IPType `json:"type"`
} }
// CreateIP: reserve a flexible IP. // CreateIP: reserve a flexible IP.
@ -4643,6 +4818,9 @@ type UpdateIPRequest struct {
IP string `json:"-"` IP string `json:"-"`
// Reverse: reverse domain name. // Reverse: reverse domain name.
Reverse *NullableStringValue `json:"reverse,omitempty"` Reverse *NullableStringValue `json:"reverse,omitempty"`
// Type: convert a 'nat' IP to a 'routed_ipv4'.
// Default value: unknown_iptype
Type IPType `json:"type"`
// Tags: an array of keywords you want to tag this IP with. // Tags: an array of keywords you want to tag this IP with.
Tags *[]string `json:"tags,omitempty"` Tags *[]string `json:"tags,omitempty"`
@ -4794,6 +4972,8 @@ type CreatePrivateNICRequest struct {
PrivateNetworkID string `json:"private_network_id,omitempty"` PrivateNetworkID string `json:"private_network_id,omitempty"`
// Tags: private NIC tags. // Tags: private NIC tags.
Tags []string `json:"tags,omitempty"` Tags []string `json:"tags,omitempty"`
// IPIDs: ip_ids defined from IPAM.
IPIDs []string `json:"ip_ids,omitempty"`
} }
// CreatePrivateNIC: create a private NIC connecting an Instance to a Private Network. // CreatePrivateNIC: create a private NIC connecting an Instance to a Private Network.

View File

@ -3,10 +3,11 @@ package instance
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/scaleway/scaleway-sdk-go/internal/async"
"sync" "sync"
"time" "time"
"github.com/scaleway/scaleway-sdk-go/internal/async"
"github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/internal/errors"
"github.com/scaleway/scaleway-sdk-go/scw" "github.com/scaleway/scaleway-sdk-go/scw"
) )
@ -109,8 +110,8 @@ func volumesToVolumeTemplates(volumes map[string]*VolumeServer) map[string]*Volu
volumeTemplates := map[string]*VolumeServerTemplate{} volumeTemplates := map[string]*VolumeServerTemplate{}
for key, volume := range volumes { for key, volume := range volumes {
volumeTemplates[key] = &VolumeServerTemplate{ volumeTemplates[key] = &VolumeServerTemplate{
ID: volume.ID, ID: &volume.ID,
Name: volume.Name, Name: &volume.Name,
} }
} }
return volumeTemplates return volumeTemplates
@ -142,9 +143,9 @@ func (s *API) AttachVolume(req *AttachVolumeRequest, opts ...scw.RequestOption)
key := fmt.Sprintf("%d", i) key := fmt.Sprintf("%d", i)
if _, ok := newVolumes[key]; !ok { if _, ok := newVolumes[key]; !ok {
newVolumes[key] = &VolumeServerTemplate{ newVolumes[key] = &VolumeServerTemplate{
ID: req.VolumeID, ID: &req.VolumeID,
// name is ignored on this PATCH // name is ignored on this PATCH
Name: req.VolumeID, Name: &req.VolumeID,
} }
found = true found = true
break break
@ -429,3 +430,35 @@ func (s *API) WaitForMACAddress(req *WaitForMACAddressRequest, opts ...scw.Reque
} }
return pn.(*PrivateNIC), nil return pn.(*PrivateNIC), nil
} }
// UnsafeSetTotalCount should not be used
// Internal usage only
func (r *GetServerTypesAvailabilityResponse) UnsafeSetTotalCount(totalCount int) {
r.TotalCount = uint32(totalCount)
}
// UnsafeGetTotalCount should not be used
// Internal usage only
func (r *GetServerTypesAvailabilityResponse) UnsafeGetTotalCount() uint32 {
return r.TotalCount
}
// UnsafeAppend should not be used
// Internal usage only
func (r *GetServerTypesAvailabilityResponse) UnsafeAppend(res interface{}) (uint32, error) {
results, ok := res.(*GetServerTypesAvailabilityResponse)
if !ok {
return 0, errors.New("%T type cannot be appended to type %T", res, r)
}
if r.Servers == nil {
r.Servers = make(map[string]*GetServerTypesAvailabilityResponseAvailability, len(results.Servers))
}
for name, serverTypeAvailability := range results.Servers {
r.Servers[name] = serverTypeAvailability
}
r.TotalCount += uint32(len(results.Servers))
return uint32(len(results.Servers)), nil
}

View File

@ -900,7 +900,7 @@ type ACLActionRedirect struct {
// Type: redirect type. // Type: redirect type.
// Default value: location // Default value: location
Type ACLActionRedirectRedirectType `json:"type"` Type ACLActionRedirectRedirectType `json:"type"`
// Target: redirect target. For a location redirect, you can use a URL e.g. `https://scaleway.com`. Using a scheme name (e.g. `https`, `http`, `ftp`, `git`) will replace the request's original scheme. This can be useful to implement HTTP to HTTPS redirects. Valid placeholders that can be used in a `location` redirect to preserve parts of the original request in the redirection URL are {{ host }}, {{ query }}, {{ path }} and {{ scheme }}. // Target: redirect target. For a location redirect, you can use a URL e.g. `https://scaleway.com`. Using a scheme name (e.g. `https`, `http`, `ftp`, `git`) will replace the request's original scheme. This can be useful to implement HTTP to HTTPS redirects. Valid placeholders that can be used in a `location` redirect to preserve parts of the original request in the redirection URL are \{\{host\}\}, \{\{query\}\}, \{\{path\}\} and \{\{scheme\}\}.
Target string `json:"target"` Target string `json:"target"`
// Code: HTTP redirect code to use. Valid values are 301, 302, 303, 307 and 308. Default value is 302. // Code: HTTP redirect code to use. Valid values are 301, 302, 303, 307 and 308. Default value is 302.
Code *int32 `json:"code"` Code *int32 `json:"code"`
@ -1589,7 +1589,7 @@ type SubscriberWebhookConfig struct {
// Zones list localities the api is available in // Zones list localities the api is available in
func (s *ZonedAPI) Zones() []scw.Zone { func (s *ZonedAPI) Zones() []scw.Zone {
return []scw.Zone{scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2} return []scw.Zone{scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2}
} }
type ZonedAPIListLBsRequest struct { type ZonedAPIListLBsRequest struct {
@ -1666,8 +1666,10 @@ type ZonedAPICreateLBRequest struct {
Name string `json:"name"` Name string `json:"name"`
// Description: description for the Load Balancer. // Description: description for the Load Balancer.
Description string `json:"description"` Description string `json:"description"`
// IPID: ID of an existing flexible IP address to attach to the Load Balancer. // Deprecated: IPID: ID of an existing flexible IP address to attach to the Load Balancer.
IPID *string `json:"ip_id"` IPID *string `json:"ip_id,omitempty"`
// AssignFlexibleIP: defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign).
AssignFlexibleIP *bool `json:"assign_flexible_ip"`
// Tags: list of tags for the Load Balancer. // Tags: list of tags for the Load Balancer.
Tags []string `json:"tags"` Tags []string `json:"tags"`
// Type: load Balancer commercial offer type. Use the Load Balancer types endpoint to retrieve a list of available offer types. // Type: load Balancer commercial offer type. Use the Load Balancer types endpoint to retrieve a list of available offer types.
@ -3373,6 +3375,8 @@ type ZonedAPIGetLBStatsRequest struct {
Zone scw.Zone `json:"-"` Zone scw.Zone `json:"-"`
// LBID: load Balancer ID. // LBID: load Balancer ID.
LBID string `json:"-"` LBID string `json:"-"`
// BackendID: ID of the backend.
BackendID *string `json:"-"`
} }
// Deprecated: GetLBStats: get usage statistics of a given Load Balancer. // Deprecated: GetLBStats: get usage statistics of a given Load Balancer.
@ -3384,6 +3388,9 @@ func (s *ZonedAPI) GetLBStats(req *ZonedAPIGetLBStatsRequest, opts ...scw.Reques
req.Zone = defaultZone req.Zone = defaultZone
} }
query := url.Values{}
parameter.AddToQuery(query, "backend_id", req.BackendID)
if fmt.Sprint(req.Zone) == "" { if fmt.Sprint(req.Zone) == "" {
return nil, errors.New("field Zone cannot be empty in request") return nil, errors.New("field Zone cannot be empty in request")
} }
@ -3395,6 +3402,7 @@ func (s *ZonedAPI) GetLBStats(req *ZonedAPIGetLBStatsRequest, opts ...scw.Reques
scwReq := &scw.ScalewayRequest{ scwReq := &scw.ScalewayRequest{
Method: "GET", Method: "GET",
Path: "/lb/v1/zones/" + fmt.Sprint(req.Zone) + "/lbs/" + fmt.Sprint(req.LBID) + "/stats", Path: "/lb/v1/zones/" + fmt.Sprint(req.Zone) + "/lbs/" + fmt.Sprint(req.LBID) + "/stats",
Query: query,
Headers: http.Header{}, Headers: http.Header{},
} }
@ -3416,6 +3424,8 @@ type ZonedAPIListBackendStatsRequest struct {
Page *int32 `json:"-"` Page *int32 `json:"-"`
// PageSize: number of items to return. // PageSize: number of items to return.
PageSize *uint32 `json:"-"` PageSize *uint32 `json:"-"`
// BackendID: ID of the backend.
BackendID *string `json:"-"`
} }
// ListBackendStats: list backend server statistics. // ListBackendStats: list backend server statistics.
@ -3436,6 +3446,7 @@ func (s *ZonedAPI) ListBackendStats(req *ZonedAPIListBackendStatsRequest, opts .
query := url.Values{} query := url.Values{}
parameter.AddToQuery(query, "page", req.Page) parameter.AddToQuery(query, "page", req.Page)
parameter.AddToQuery(query, "page_size", req.PageSize) parameter.AddToQuery(query, "page_size", req.PageSize)
parameter.AddToQuery(query, "backend_id", req.BackendID)
if fmt.Sprint(req.Zone) == "" { if fmt.Sprint(req.Zone) == "" {
return nil, errors.New("field Zone cannot be empty in request") return nil, errors.New("field Zone cannot be empty in request")
@ -4641,8 +4652,10 @@ type CreateLBRequest struct {
Name string `json:"name"` Name string `json:"name"`
// Description: description for the Load Balancer. // Description: description for the Load Balancer.
Description string `json:"description"` Description string `json:"description"`
// IPID: ID of an existing flexible IP address to attach to the Load Balancer. // Deprecated: IPID: ID of an existing flexible IP address to attach to the Load Balancer.
IPID *string `json:"ip_id"` IPID *string `json:"ip_id,omitempty"`
// AssignFlexibleIP: defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign).
AssignFlexibleIP *bool `json:"assign_flexible_ip"`
// Tags: list of tags for the Load Balancer. // Tags: list of tags for the Load Balancer.
Tags []string `json:"tags"` Tags []string `json:"tags"`
// Type: load Balancer commercial offer type. Use the Load Balancer types endpoint to retrieve a list of available offer types. // Type: load Balancer commercial offer type. Use the Load Balancer types endpoint to retrieve a list of available offer types.
@ -6319,6 +6332,8 @@ type GetLBStatsRequest struct {
Region scw.Region `json:"-"` Region scw.Region `json:"-"`
// LBID: load Balancer ID. // LBID: load Balancer ID.
LBID string `json:"-"` LBID string `json:"-"`
// BackendID: ID of the backend.
BackendID *string `json:"-"`
} }
// Deprecated: GetLBStats: get usage statistics of a given load balancer. // Deprecated: GetLBStats: get usage statistics of a given load balancer.
@ -6330,6 +6345,9 @@ func (s *API) GetLBStats(req *GetLBStatsRequest, opts ...scw.RequestOption) (*LB
req.Region = defaultRegion req.Region = defaultRegion
} }
query := url.Values{}
parameter.AddToQuery(query, "backend_id", req.BackendID)
if fmt.Sprint(req.Region) == "" { if fmt.Sprint(req.Region) == "" {
return nil, errors.New("field Region cannot be empty in request") return nil, errors.New("field Region cannot be empty in request")
} }
@ -6341,6 +6359,7 @@ func (s *API) GetLBStats(req *GetLBStatsRequest, opts ...scw.RequestOption) (*LB
scwReq := &scw.ScalewayRequest{ scwReq := &scw.ScalewayRequest{
Method: "GET", Method: "GET",
Path: "/lb/v1/regions/" + fmt.Sprint(req.Region) + "/lbs/" + fmt.Sprint(req.LBID) + "/stats", Path: "/lb/v1/regions/" + fmt.Sprint(req.Region) + "/lbs/" + fmt.Sprint(req.LBID) + "/stats",
Query: query,
Headers: http.Header{}, Headers: http.Header{},
} }
@ -6362,8 +6381,11 @@ type ListBackendStatsRequest struct {
Page *int32 `json:"-"` Page *int32 `json:"-"`
// PageSize: number of items to return. // PageSize: number of items to return.
PageSize *uint32 `json:"-"` PageSize *uint32 `json:"-"`
// BackendID: ID of the backend.
BackendID *string `json:"-"`
} }
// ListBackendStats: list backend server statistics.
func (s *API) ListBackendStats(req *ListBackendStatsRequest, opts ...scw.RequestOption) (*ListBackendStatsResponse, error) { func (s *API) ListBackendStats(req *ListBackendStatsRequest, opts ...scw.RequestOption) (*ListBackendStatsResponse, error) {
var err error var err error
@ -6380,6 +6402,7 @@ func (s *API) ListBackendStats(req *ListBackendStatsRequest, opts ...scw.Request
query := url.Values{} query := url.Values{}
parameter.AddToQuery(query, "page", req.Page) parameter.AddToQuery(query, "page", req.Page)
parameter.AddToQuery(query, "page_size", req.PageSize) parameter.AddToQuery(query, "page_size", req.PageSize)
parameter.AddToQuery(query, "backend_id", req.BackendID)
if fmt.Sprint(req.Region) == "" { if fmt.Sprint(req.Region) == "" {
return nil, errors.New("field Region cannot be empty in request") return nil, errors.New("field Region cannot be empty in request")

View File

@ -33,7 +33,7 @@ const configFileTemplate = `# Scaleway configuration file
# - Scaleway Terraform Provider (https://www.terraform.io/docs/providers/scaleway/index.html) # - Scaleway Terraform Provider (https://www.terraform.io/docs/providers/scaleway/index.html)
# You need an access key and a secret key to connect to Scaleway API. # You need an access key and a secret key to connect to Scaleway API.
# Generate your token at the following address: https://console.scaleway.com/project/credentials # Generate your token at the following address: https://console.scaleway.com/iam/api-keys
# An access key is a secret key identifier. # An access key is a secret key identifier.
{{ if .AccessKey }}access_key: {{.AccessKey}}{{ else }}# access_key: SCW11111111111111111{{ end }} {{ if .AccessKey }}access_key: {{.AccessKey}}{{ else }}# access_key: SCW11111111111111111{{ end }}

View File

@ -264,7 +264,7 @@ func (d *Duration) ToTimeDuration() *time.Duration {
if d == nil { if d == nil {
return nil return nil
} }
timeDuration := time.Duration(d.Nanos) + time.Duration(d.Seconds/1e9) timeDuration := time.Duration(d.Nanos) + time.Duration(d.Seconds)*time.Second
return &timeDuration return &timeDuration
} }

2
vendor/modules.txt generated vendored
View File

@ -767,7 +767,7 @@ github.com/russross/blackfriday/v2
# github.com/sahilm/fuzzy v0.1.0 # github.com/sahilm/fuzzy v0.1.0
## explicit ## explicit
github.com/sahilm/fuzzy github.com/sahilm/fuzzy
# github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17 # github.com/scaleway/scaleway-sdk-go v1.0.0-beta.19
## explicit; go 1.17 ## explicit; go 1.17
github.com/scaleway/scaleway-sdk-go/api/domain/v2beta1 github.com/scaleway/scaleway-sdk-go/api/domain/v2beta1
github.com/scaleway/scaleway-sdk-go/api/iam/v1alpha1 github.com/scaleway/scaleway-sdk-go/api/iam/v1alpha1