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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/account/v2alpha1/account_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func (s *API) GetSSHKey(req *GetSSHKeyRequest, opts ...scw.RequestOption) (*SSHK

type UpdateSSHKeyRequest struct {
SSHKeyID string `json:"-"`

// Name: name of the SSH key
Name *string `json:"name"`
}

Expand Down
22 changes: 11 additions & 11 deletions api/instance/v1/instance_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ func (s *API) DeleteServer(req *DeleteServerRequest, opts ...scw.RequestOption)

type GetServerRequest struct {
Zone scw.Zone `json:"-"`

// ServerID: UUID of the server you want to get
ServerID string `json:"-"`
}

Expand Down Expand Up @@ -2138,7 +2138,7 @@ func (r *ListImagesResponse) UnsafeAppend(res interface{}) (uint32, error) {

type GetImageRequest struct {
Zone scw.Zone `json:"-"`

// ImageID: UUID of the image you want to get
ImageID string `json:"-"`
}

Expand Down Expand Up @@ -2316,7 +2316,7 @@ func (s *API) setImage(req *SetImageRequest, opts ...scw.RequestOption) (*setIma

type DeleteImageRequest struct {
Zone scw.Zone `json:"-"`

// ImageID: UUID of the image you want to delete
ImageID string `json:"-"`
}

Expand Down Expand Up @@ -2477,7 +2477,7 @@ func (s *API) CreateSnapshot(req *CreateSnapshotRequest, opts ...scw.RequestOpti

type GetSnapshotRequest struct {
Zone scw.Zone `json:"-"`

// SnapshotID: UUID of the snapshot you want to get
SnapshotID string `json:"-"`
}

Expand Down Expand Up @@ -2587,7 +2587,7 @@ func (s *API) setSnapshot(req *SetSnapshotRequest, opts ...scw.RequestOption) (*

type DeleteSnapshotRequest struct {
Zone scw.Zone `json:"-"`

// SnapshotID: UUID of the snapshot you want to delete
SnapshotID string `json:"-"`
}

Expand Down Expand Up @@ -2762,7 +2762,7 @@ func (s *API) CreateVolume(req *CreateVolumeRequest, opts ...scw.RequestOption)

type GetVolumeRequest struct {
Zone scw.Zone `json:"-"`

// VolumeID: UUID of the volume you want to get
VolumeID string `json:"-"`
}

Expand Down Expand Up @@ -2851,7 +2851,7 @@ func (s *API) UpdateVolume(req *UpdateVolumeRequest, opts ...scw.RequestOption)

type DeleteVolumeRequest struct {
Zone scw.Zone `json:"-"`

// VolumeID: UUID of the volume you want to delete
VolumeID string `json:"-"`
}

Expand Down Expand Up @@ -3032,7 +3032,7 @@ func (s *API) CreateSecurityGroup(req *CreateSecurityGroupRequest, opts ...scw.R

type GetSecurityGroupRequest struct {
Zone scw.Zone `json:"-"`

// SecurityGroupID: UUID of the security group you want to get
SecurityGroupID string `json:"-"`
}

Expand Down Expand Up @@ -3072,7 +3072,7 @@ func (s *API) GetSecurityGroup(req *GetSecurityGroupRequest, opts ...scw.Request

type DeleteSecurityGroupRequest struct {
Zone scw.Zone `json:"-"`

// SecurityGroupID: UUID of the security group you want to delete
SecurityGroupID string `json:"-"`
}

Expand Down Expand Up @@ -3620,7 +3620,7 @@ func (s *API) CreatePlacementGroup(req *CreatePlacementGroupRequest, opts ...scw

type GetPlacementGroupRequest struct {
Zone scw.Zone `json:"-"`

// PlacementGroupID: UUID of the placement group you want to get
PlacementGroupID string `json:"-"`
}

Expand Down Expand Up @@ -3777,7 +3777,7 @@ func (s *API) UpdatePlacementGroup(req *UpdatePlacementGroupRequest, opts ...scw

type DeletePlacementGroupRequest struct {
Zone scw.Zone `json:"-"`

// PlacementGroupID: UUID of the placement group you want to delete
PlacementGroupID string `json:"-"`
}

Expand Down
52 changes: 46 additions & 6 deletions api/rdb/v1/rdb_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,9 @@ type ListInstanceACLRulesResponse struct {
TotalCount uint32 `json:"total_count"`
}

// ListInstanceLogsResponse: list instance logs response
type ListInstanceLogsResponse struct {
// InstanceLogs: available logs in a given instance
InstanceLogs []*InstanceLog `json:"instance_logs"`
}

Expand Down Expand Up @@ -1339,7 +1341,7 @@ func (s *API) RestoreDatabaseBackup(req *RestoreDatabaseBackupRequest, opts ...s

type ExportDatabaseBackupRequest struct {
Region scw.Region `json:"-"`

// DatabaseBackupID: UUID of the database backup you want to export
DatabaseBackupID string `json:"-"`
}

Expand Down Expand Up @@ -1494,12 +1496,12 @@ func (r *ListDatabaseEnginesResponse) UnsafeAppend(res interface{}) (uint32, err

type UpgradeInstanceRequest struct {
Region scw.Region `json:"-"`

// InstanceID: UUID of the instance you want to upgrade
InstanceID string `json:"-"`

// NodeType: node type of the instance you want to upgrade to
// Precisely one of EnableHa, NodeType must be set.
NodeType *string `json:"node_type,omitempty"`

// EnableHa: set to true to enable high availability on your instance
// Precisely one of EnableHa, NodeType must be set.
EnableHa *bool `json:"enable_ha,omitempty"`
}
Expand Down Expand Up @@ -1900,9 +1902,9 @@ func (s *API) PrepareInstanceLogs(req *PrepareInstanceLogsRequest, opts ...scw.R

type ListInstanceLogsRequest struct {
Region scw.Region `json:"-"`

// InstanceID: UUID of the instance you want logs of
InstanceID string `json:"-"`
// OrderBy:
// OrderBy: criteria to use when ordering instance logs listing
//
// Default value: created_at_asc
OrderBy ListInstanceLogsRequestOrderBy `json:"-"`
Expand Down Expand Up @@ -1944,6 +1946,44 @@ func (s *API) ListInstanceLogs(req *ListInstanceLogsRequest, opts ...scw.Request
return &resp, nil
}

type GetInstanceLogRequest struct {
Region scw.Region `json:"-"`
// InstanceLogID: UUID of the instance_log you want
InstanceLogID string `json:"-"`
}

// GetInstanceLog: get specific logs of a given instance
func (s *API) GetInstanceLog(req *GetInstanceLogRequest, opts ...scw.RequestOption) (*InstanceLog, error) {
var err error

if req.Region == "" {
defaultRegion, _ := s.client.GetDefaultRegion()
req.Region = defaultRegion
}

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

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

scwReq := &scw.ScalewayRequest{
Method: "GET",
Path: "/rdb/v1/regions/" + fmt.Sprint(req.Region) + "/logs/" + fmt.Sprint(req.InstanceLogID) + "",
Headers: http.Header{},
}

var resp InstanceLog

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

type GetInstanceMetricsRequest struct {
Region scw.Region `json:"-"`
// InstanceID: UUID of the instance
Expand Down
10 changes: 5 additions & 5 deletions api/test/v1/test_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func (r *ListHumansResponse) UnsafeAppend(res interface{}) (uint32, error) {

type GetHumanRequest struct {
Region scw.Region `json:"-"`

// HumanID: UUID of the human you want to get
HumanID string `json:"-"`
}

Expand Down Expand Up @@ -467,7 +467,7 @@ func (s *API) CreateHuman(req *CreateHumanRequest, opts ...scw.RequestOption) (*

type UpdateHumanRequest struct {
Region scw.Region `json:"-"`

// HumanID: UUID of the human you want to update
HumanID string `json:"-"`

Height *float64 `json:"height"`
Expand Down Expand Up @@ -532,7 +532,7 @@ func (s *API) UpdateHuman(req *UpdateHumanRequest, opts ...scw.RequestOption) (*

type DeleteHumanRequest struct {
Region scw.Region `json:"-"`

// HumanID: UUID of the human you want to delete
HumanID string `json:"-"`
}

Expand Down Expand Up @@ -572,7 +572,7 @@ func (s *API) DeleteHuman(req *DeleteHumanRequest, opts ...scw.RequestOption) (*

type RunHumanRequest struct {
Region scw.Region `json:"-"`

// HumanID: UUID of the human you want to make run
HumanID string `json:"-"`
}

Expand Down Expand Up @@ -617,7 +617,7 @@ func (s *API) RunHuman(req *RunHumanRequest, opts ...scw.RequestOption) (*Human,

type SmokeHumanRequest struct {
Region scw.Region `json:"-"`

// HumanID: UUID of the human you want to make smoking
HumanID string `json:"-"`
}

Expand Down