v1.5.0
This commit is contained in:
@@ -20,7 +20,7 @@ type AffinityGroupComputesRequest struct {
|
||||
}
|
||||
|
||||
// AffinityGroupComputes gets list of all computes with their relationships to another computes
|
||||
func (r RG) AffinityGroupComputes(ctx context.Context, req AffinityGroupComputesRequest) (ListAffinityGroups, error) {
|
||||
func (r RG) AffinityGroupComputes(ctx context.Context, req AffinityGroupComputesRequest) (ListAffinityGroupsComputes, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
@@ -35,7 +35,7 @@ func (r RG) AffinityGroupComputes(ctx context.Context, req AffinityGroupComputes
|
||||
return nil, err
|
||||
}
|
||||
|
||||
list := ListAffinityGroups{}
|
||||
list := ListAffinityGroupsComputes{}
|
||||
|
||||
err = json.Unmarshal(res, &list)
|
||||
if err != nil {
|
||||
|
||||
@@ -16,7 +16,7 @@ type AffinityGroupsListRequest struct {
|
||||
}
|
||||
|
||||
// AffinityGroupsList gets all currently defined affinity groups in this resource group with compute IDs
|
||||
func (r RG) AffinityGroupsList(ctx context.Context, req AffinityGroupsListRequest) (map[string][]uint64, error) {
|
||||
func (r RG) AffinityGroupsList(ctx context.Context, req AffinityGroupsListRequest) (*ListAffinityGroups, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
@@ -31,7 +31,7 @@ func (r RG) AffinityGroupsList(ctx context.Context, req AffinityGroupsListReques
|
||||
return nil, err
|
||||
}
|
||||
|
||||
list := map[string][]uint64{}
|
||||
list := &ListAffinityGroups{}
|
||||
|
||||
err = json.Unmarshal(res, &list)
|
||||
if err != nil {
|
||||
|
||||
@@ -53,6 +53,9 @@ type ItemResourceConsumption struct {
|
||||
// Reserved information about resources
|
||||
Reserved Resource `json:"Reserved"`
|
||||
|
||||
// Resource limits
|
||||
ResourceLimits ResourceLimits `json:"resourceLimits"`
|
||||
|
||||
// Resource group ID
|
||||
RGID uint64 `json:"rgid"`
|
||||
}
|
||||
@@ -302,7 +305,7 @@ type ResourceLimits struct {
|
||||
}
|
||||
|
||||
// Main information about affinity group
|
||||
type ItemAffinityGroup struct {
|
||||
type ItemAffinityGroupComputes struct {
|
||||
// Compute ID
|
||||
ComputeID uint64 `json:"computeId"`
|
||||
|
||||
@@ -326,7 +329,15 @@ type ItemAffinityGroup struct {
|
||||
}
|
||||
|
||||
// List of affinity groups
|
||||
type ListAffinityGroups []ItemAffinityGroup
|
||||
type ListAffinityGroupsComputes []ItemAffinityGroupComputes
|
||||
|
||||
type ListAffinityGroups struct {
|
||||
// Data
|
||||
Data map[string][]uint64 `json:"data"`
|
||||
|
||||
// Entry count
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
// Main information about audit
|
||||
type ItemAudit struct {
|
||||
|
||||
@@ -37,6 +37,7 @@ func (r RG) Usage(ctx context.Context, req UsageRequest) (*RecordResourceUsage,
|
||||
|
||||
info := RecordResourceUsage{}
|
||||
err = json.Unmarshal(res, &info)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user