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
316 changes: 158 additions & 158 deletions docs/index.html

Large diffs are not rendered by default.

458 changes: 343 additions & 115 deletions openapi/spec.yaml

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions rla/internal/nsmapi/gen/nvswitch-manager.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions rla/internal/nsmapi/gen/nvswitch-manager_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions sdk/simple/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
logger := LoggerFromContext(ctx)
logger.Info().Msgf("Fetching Sites for org: %s", am.Organization)

sites, resp, err := apiClient.SiteAPI.GetAllSite(ctx, am.Organization).PageSize(100).Execute()

Check failure on line 81 in sdk/simple/api.go

View workflow job for this annotation

GitHub Actions / Lint and Test / Lint Go

response body must be closed (bodyclose)

Check failure on line 81 in sdk/simple/api.go

View workflow job for this annotation

GitHub Actions / Lint and Test / Lint Go

response body must be closed (bodyclose)
apiErr := HandleResponseError(resp, err)
if apiErr != nil {
return apiErr
Expand Down Expand Up @@ -182,8 +182,8 @@
if vpc.Name != nil {
am.VpcName = *vpc.Name
}
if vpc.NetworkVirtualizationType != nil {
am.VpcNetworkVirtualizationType = *vpc.NetworkVirtualizationType
if vpc.NetworkVirtualizationType.IsSet() {
am.VpcNetworkVirtualizationType = *vpc.NetworkVirtualizationType.Get()
}
logger.Info().Msgf("Default VPC %s (%s) with NetworkVirtualizationType '%s' has been set for Instance creation.", am.VpcName, am.VpcID, am.VpcNetworkVirtualizationType)
break
Expand All @@ -208,8 +208,8 @@
if vpcs[0].Name != nil {
am.VpcName = *vpcs[0].Name
}
if vpcs[0].NetworkVirtualizationType != nil {
am.VpcNetworkVirtualizationType = *vpcs[0].NetworkVirtualizationType
if vpcs[0].NetworkVirtualizationType.IsSet() {
am.VpcNetworkVirtualizationType = *vpcs[0].NetworkVirtualizationType.Get()
}
if len(vpcs) > 1 {
logger.Warn().Msgf("Multiple VPCs configured for Site: %s. Will default to VPC: %s (%s) with NetworkVirtualizationType '%s' for Instance creation.", am.SiteName, am.VpcName, am.VpcID, am.VpcNetworkVirtualizationType)
Expand Down
6 changes: 3 additions & 3 deletions sdk/simple/dpuextensionservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ func (dm DpuExtensionServiceManager) Update(ctx context.Context, id string, requ

apiReq := standard.DpuExtensionServiceUpdateRequest{}
if request.Name != nil {
apiReq.Name = request.Name
apiReq.Name.Set(request.Name)
}
if request.Description != nil {
apiReq.Description = request.Description
apiReq.Description.Set(request.Description)
}
if request.Data != nil {
apiReq.Data = request.Data
apiReq.Data.Set(request.Data)
}
apiDes, resp, err := dm.client.apiClient.DPUExtensionServiceAPI.UpdateDpuExtensionService(ctx, dm.client.apiMetadata.Organization, id).
DpuExtensionServiceUpdateRequest(apiReq).Execute()
Expand Down
4 changes: 2 additions & 2 deletions sdk/simple/examples/instance/filter_by_name/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ func main() {
machineID := instance.GetMachineId()
fmt.Printf(" - Name: %s, ID: %s, Status: %s, MachineID: %s\n",
name, instance.GetId(), status, machineID)
if instance.Description != nil {
fmt.Printf(" Description: %s\n", *instance.Description)
if instance.Description.IsSet() {
fmt.Printf(" Description: %s\n", *instance.Description.Get())
}
if instance.Labels != nil {
fmt.Printf(" Labels: %v\n", instance.Labels)
Expand Down
12 changes: 7 additions & 5 deletions sdk/simple/infinibandpartition.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func infinibandPartitionFromStandard(api standard.InfiniBandPartition) Infiniban
if api.Name != nil {
ip.Name = *api.Name
}
ip.Description = api.Description
ip.Description = api.Description.Get()
if api.PartitionKey.IsSet() {
ip.PartitionKey = api.PartitionKey.Get()
}
Expand All @@ -88,9 +88,11 @@ func (ipm InfinibandPartitionManager) Create(ctx context.Context, request Infini
ctx = context.WithValue(ctx, standard.ContextAccessToken, ipm.client.Config.Token)

apiReq := standard.InfiniBandPartitionCreateRequest{
Name: request.Name,
Description: request.Description,
SiteId: ipm.client.apiMetadata.SiteID,
Name: request.Name,
SiteId: ipm.client.apiMetadata.SiteID,
}
if request.Description != nil {
apiReq.Description.Set(request.Description)
}
apiIb, resp, err := ipm.client.apiClient.InfiniBandPartitionAPI.CreateInfinibandPartition(ctx, ipm.client.apiMetadata.Organization).
InfiniBandPartitionCreateRequest(apiReq).Execute()
Expand Down Expand Up @@ -172,7 +174,7 @@ func (ipm InfinibandPartitionManager) Update(ctx context.Context, id string, req
}
apiReq := standard.InfiniBandPartitionUpdateRequest{Name: name}
if request.Description != nil {
apiReq.Description = request.Description
apiReq.Description.Set(request.Description)
}
apiIb, resp, err := ipm.client.apiClient.InfiniBandPartitionAPI.UpdateInfinibandPartition(ctx, ipm.client.apiMetadata.Organization, id).
InfiniBandPartitionUpdateRequest(apiReq).Execute()
Expand Down
2 changes: 1 addition & 1 deletion sdk/simple/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ func toStandardInstanceCreateRequest(request InstanceCreateRequest, sshKeyGroupI
apiReq := standard.InstanceCreateRequest{
Name: request.Name,
TenantId: am.TenantID,
MachineId: &request.MachineID,
VpcId: vpcID,
Labels: request.Labels,
SshKeyGroupIds: sshKeyGroupIDs,
Interfaces: []standard.InterfaceCreateRequest{defaultIface},
}
apiReq.MachineId.Set(&request.MachineID)
if request.Description != nil {
apiReq.Description.Set(request.Description)
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/simple/ipblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewIpBlockManager(client *Client) IpBlockManager {
func ipBlockFromStandard(api standard.IpBlock) IpBlock {
ib := IpBlock{
Name: api.Name,
Description: api.Description,
Description: api.Description.Get(),
SiteID: api.SiteId,
ProtocolVersion: api.ProtocolVersion,
}
Expand Down
16 changes: 8 additions & 8 deletions sdk/simple/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ func NewMachineManager(client *Client) MachineManager {

func machineFromStandard(api standard.Machine) Machine {
m := Machine{
Vendor: api.Vendor,
ProductName: api.ProductName,
SerialNumber: api.SerialNumber,
Vendor: api.Vendor.Get(),
ProductName: api.ProductName.Get(),
SerialNumber: api.SerialNumber.Get(),
Labels: api.Labels,
}
if api.Id != nil {
Expand Down Expand Up @@ -149,18 +149,18 @@ func machineFromStandard(api standard.Machine) Machine {
mai := MachineAdminInterface{
ID: mi.Id,
IsPrimary: mi.IsPrimary,
MacAddress: mi.MacAddress,
MacAddress: mi.MacAddress.Get(),
IpAddresses: mi.IpAddresses,
Created: mi.Created,
Updated: mi.Updated,
}
m.AdminInterfaces = append(m.AdminInterfaces, mai)
if m.Hostname == nil && mi.Hostname != nil && (mi.IsPrimary != nil && *mi.IsPrimary) {
m.Hostname = mi.Hostname
if m.Hostname == nil && mi.Hostname.IsSet() && (mi.IsPrimary != nil && *mi.IsPrimary) {
m.Hostname = mi.Hostname.Get()
}
}
if m.Hostname == nil && len(api.MachineInterfaces) > 0 && api.MachineInterfaces[0].Hostname != nil {
m.Hostname = api.MachineInterfaces[0].Hostname
if m.Hostname == nil && len(api.MachineInterfaces) > 0 && api.MachineInterfaces[0].Hostname.IsSet() {
m.Hostname = api.MachineInterfaces[0].Hostname.Get()
}
return m
}
Expand Down
14 changes: 8 additions & 6 deletions sdk/simple/nvlinklogicalpartition.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func nvLinkLogicalPartitionFromStandard(api standard.NVLinkLogicalPartition) NVL
if api.Name != nil {
nl.Name = *api.Name
}
nl.Description = api.Description
nl.Description = api.Description.Get()
if api.Status != nil {
nl.Status = string(*api.Status)
}
Expand All @@ -84,9 +84,11 @@ func (nlm NVLinkLogicalPartitionManager) Create(ctx context.Context, request NVL
ctx = context.WithValue(ctx, standard.ContextAccessToken, nlm.client.Config.Token)

apiReq := standard.NVLinkLogicalPartitionCreateRequest{
Name: request.Name,
Description: request.Description,
SiteId: nlm.client.apiMetadata.SiteID,
Name: request.Name,
SiteId: nlm.client.apiMetadata.SiteID,
}
if request.Description != nil {
apiReq.Description.Set(request.Description)
}
apiNl, resp, err := nlm.client.apiClient.NVLinkLogicalPartitionAPI.CreateNvlinkLogicalPartition(ctx, nlm.client.apiMetadata.Organization).
NVLinkLogicalPartitionCreateRequest(apiReq).Execute()
Expand Down Expand Up @@ -160,10 +162,10 @@ func (nlm NVLinkLogicalPartitionManager) Update(ctx context.Context, id string,

apiReq := standard.NVLinkLogicalPartitionUpdateRequest{}
if request.Name != nil {
apiReq.Name = request.Name
apiReq.Name.Set(request.Name)
}
if request.Description != nil {
apiReq.Description = request.Description
apiReq.Description.Set(request.Description)
}
apiNl, resp, err := nlm.client.apiClient.NVLinkLogicalPartitionAPI.UpdateNvlinkLogicalPartition(ctx, nlm.client.apiMetadata.Organization, id).
NVLinkLogicalPartitionUpdateRequest(apiReq).Execute()
Expand Down
4 changes: 2 additions & 2 deletions sdk/simple/operatingsystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func operatingSystemFromStandard(api standard.OperatingSystem) OperatingSystem {
if api.Name != nil {
os.Name = *api.Name
}
os.Description = api.Description
os.Description = api.Description.Get()
if api.IpxeScript.IsSet() {
os.IpxeScript = api.IpxeScript.Get()
}
Expand All @@ -96,7 +96,7 @@ func (osm OperatingSystemManager) Create(ctx context.Context, request OperatingS
ctx = context.WithValue(ctx, standard.ContextAccessToken, osm.client.Config.Token)

apiReq := standard.OperatingSystemCreateRequest{Name: request.Name}
apiReq.Description = request.Description
apiReq.Description.Set(request.Description)
if osm.client.apiMetadata.TenantID != "" {
apiReq.TenantId.Set(&osm.client.apiMetadata.TenantID)
}
Expand Down
6 changes: 3 additions & 3 deletions sdk/simple/vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func vpcFromStandard(api standard.VPC) Vpc {
if api.Name != nil {
v.Name = *api.Name
}
v.Description = api.Description
if api.NetworkVirtualizationType != nil {
v.NetworkVirtualizationType = *api.NetworkVirtualizationType
v.Description = api.Description.Get()
if api.NetworkVirtualizationType.IsSet() {
v.NetworkVirtualizationType = *api.NetworkVirtualizationType.Get()
}
if api.Created != nil {
v.Created = *api.Created
Expand Down
33 changes: 22 additions & 11 deletions sdk/standard/model_allocation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading