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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,11 @@ navigation:
- page: Getting Started
path: ../rest-api/openapi/getting-started.md
icon: circle-play
- page: Resource Overview
path: ../rest-api/openapi/resource-overview.md
icon: layer-group
- page: Example REST API Workflows
path: ../rest-api/openapi/example_workflows.md
path: ../rest-api/openapi/example-workflows.md
icon: gear
- page: Deprecations
path: ../rest-api/openapi/deprecations.md
Expand Down
2 changes: 1 addition & 1 deletion rest-api/api/pkg/api/handler/machineinstancetype_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ func TestGetAllMachineInstanceTypeHandler_Handle(t *testing.T) {
assert.Equal(t, tt.wantTotalCount, pr.Total)

if tt.wantFirstEntry != nil {
assert.Equal(t, tt.wantFirstEntry.ID.String(), rst[0].ID)
assert.Equal(t, tt.wantFirstEntry.MachineID, rst[0].MachineID)
}

if tt.verifyChildSpanner {
Expand Down
2 changes: 1 addition & 1 deletion rest-api/api/pkg/api/model/allocationconstraint.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (

var (
// resourceTypeIDDeprecationTime is the time when the ResourceTypeID attribute will be no longer be available in the API
resourceTypeIDDeprecationTime, _ = time.Parse(time.RFC1123, "Thu, 09 Jul 2026 00:00:00 UTC")
resourceTypeIDDeprecationTime = time.Date(2026, time.September, 10, 0, 0, 0, 0, time.UTC)

// resourceTypeIDDeprecations is a list of deprecated entities for the ResourceTypeID attribute
allocationConstraintDeprecations = []DeprecatedEntity{
Expand Down
13 changes: 8 additions & 5 deletions rest-api/api/pkg/api/model/machineinstancetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

var (
// Time when the Machine/InstanceType association ID attribute will be deprecated.
machineInstanceTypeAssociationIDDeprecationTime, _ = time.Parse(time.RFC1123, "Thu, 09 Jul 2026 00:00:00 UTC")
machineInstanceTypeAssociationIDDeprecationTime = time.Date(2026, time.August, 9, 0, 0, 0, 0, time.UTC)

machineInstanceTypeDeprecations = []DeprecatedEntity{
{
Expand Down Expand Up @@ -61,29 +61,32 @@ func (mitcr *APIMachineInstanceTypeCreateRequest) ToProto(it *cdbm.InstanceType)
// APIMachineInstanceType is the data structure to capture Machine Instance Type
type APIMachineInstanceType struct {
// ID is the unique UUID v4 identifier for the Machine Instance Type
ID string `json:"id"`
ID *string `json:"id,omitempty"`
// MachineID is the ID of the associated Machine
MachineID string `json:"machineId"`
// InstanceTypeID is the ID of the associated Instance Type
InstanceTypeID string `json:"instanceTypeId"`
// Deprecations is the list of deprecation messages denoting fields which are being deprecated
Deprecations []APIDeprecation `json:"deprecations,omitempty"`
// Created is the date and time the Machine Instance Type was created
Created time.Time `json:"created"`
// Updated is the date and time the Machine Instance Type was last updated
Updated time.Time `json:"updated"`
// Deprecations is the list of deprecation messages denoting fields which are being deprecated
Deprecations []APIDeprecation `json:"deprecations,omitempty"`
}

// NewAPIMachineInstanceType creates a new APIMachineInstanceType
func NewAPIMachineInstanceType(dbmit *cdbm.MachineInstanceType) *APIMachineInstanceType {
apiMachineInstanceType := &APIMachineInstanceType{
ID: dbmit.ID.String(),
MachineID: dbmit.MachineID,
InstanceTypeID: dbmit.InstanceTypeID.String(),
Created: dbmit.Created,
Updated: dbmit.Updated,
}

if time.Now().Before(machineInstanceTypeAssociationIDDeprecationTime) {
apiMachineInstanceType.ID = cutil.GetPtr(dbmit.ID.String())
}

// Populate deprecation metadata for deprecated response fields.
for _, deprecation := range machineInstanceTypeDeprecations {
apiMachineInstanceType.Deprecations = append(apiMachineInstanceType.Deprecations, NewAPIDeprecation(deprecation))
Expand Down
3 changes: 2 additions & 1 deletion rest-api/api/pkg/api/model/machineinstancetype_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"
"time"

cutil "github.com/NVIDIA/infra-controller/rest-api/common/pkg/util"
cdbm "github.com/NVIDIA/infra-controller/rest-api/db/pkg/db/model"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -38,7 +39,7 @@ func TestNewAPIMachineInstanceType(t *testing.T) {
},
want: func() *APIMachineInstanceType {
expected := &APIMachineInstanceType{
ID: dbmit.ID.String(),
ID: cutil.GetPtr(dbmit.ID.String()),
MachineID: dbmit.MachineID,
InstanceTypeID: dbmit.InstanceTypeID.String(),
Created: dbmit.Created,
Expand Down
2 changes: 1 addition & 1 deletion rest-api/api/pkg/api/model/networksecuritygroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var NetworkSecurityGroupRuleAPIPropagationStatusFromProtobufPropagationStatus =

var (
// Time when the NetworkSecurityGroup propagation object_id attribute will be deprecated
networkSecurityGroupPropagationObjectIDDeprecationTime, _ = time.Parse(time.RFC1123, "Thu, 09 Jul 2026 00:00:00 UTC")
networkSecurityGroupPropagationObjectIDDeprecationTime = time.Date(2026, time.September, 10, 0, 0, 0, 0, time.UTC)

// Deprecations for the NetworkSecurityGroup model
networkSecurityGroupPropagationDetailsDeprecations = []DeprecatedEntity{
Expand Down
2 changes: 1 addition & 1 deletion rest-api/api/pkg/api/model/nvlinkinterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

var (
// Time when nvLinklogicalPartitionId attribute will be deprecated
nvLinkLogicalPartitionIDDeprecationTime, _ = time.Parse(time.RFC1123, "Thu, 09 Jul 2026 00:00:00 UTC")
nvLinkLogicalPartitionIDDeprecationTime = time.Date(2026, time.September, 10, 0, 0, 0, 0, time.UTC)

// Deprecations for the NVLinkInterface model
nvLinkLogicalPartitionIDDeprecations = []DeprecatedEntity{
Expand Down
2 changes: 1 addition & 1 deletion rest-api/api/pkg/api/model/tenantaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (

var (
// Time when the AccountNumber, SubscriptionID, and SubscriptionTier attributes will be deprecated
accountNumberSubscriptionIDTierDeprecationTime, _ = time.Parse(time.RFC1123, "Thu, 09 Jul 2026 00:00:00 UTC")
accountNumberSubscriptionIDTierDeprecationTime = time.Date(2026, time.September, 10, 0, 0, 0, 0, time.UTC)

tenantAccountDeprecations = []DeprecatedEntity{
{
Expand Down
Loading
Loading