Skip to content

Add support for 4.22.1.0 release - #143

Draft
Pearl1594 wants to merge 3 commits into
mainfrom
support-4.22.1.0
Draft

Add support for 4.22.1.0 release#143
Pearl1594 wants to merge 3 commits into
mainfrom
support-4.22.1.0

Conversation

@Pearl1594

Copy link
Copy Markdown
Contributor

The main change in this PR is:

…144)

* Add support for managing guest OS category - create, delete, update

---------

Co-authored-by: Pearl Dsilva <pearl1954@gmail.com>
Copilot AI lite review requested due to automatic review settings August 5, 2026 06:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CloudStack Go SDK/codegen artifacts to align with Apache CloudStack 4.22.1.0, primarily by incorporating updated API metadata (listApis.json) and regenerating affected services (including new params/response fields and new GuestOS OS-category APIs).

Changes:

  • Override queryAsyncJobResult.jobid handling via requiredParams.go and adjust codegen/client async polling logic.
  • Regenerate multiple service bindings from updated generate/listApis.json (new request params like resourceid/resourcetype, new response fields like alloweddetails, etc.).
  • Add GuestOS OS-category API surface (addOsCategory/deleteOsCategory/updateOsCategory) and corresponding tests/mocks.

Reviewed changes

Copilot reviewed 53 out of 55 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test/GuestOSService_test.go Adds tests for new GuestOS OS-category APIs.
generate/requiredParams.go Adds required-param override for queryAsyncJobResult.jobid.
generate/layout.go Registers OS-category commands under GuestOS service for generation/layout.
generate/generate.go Updates generated GetAsyncJobResult template logic for QueryAsyncJobResult params creation.
cloudstack/cloudstack.go Updates client helper GetAsyncJobResult implementation.
cloudstack/AsyncjobService.go Adds resourceid/resourcetype support to async-job query/list params.
cloudstack/GuestOSService.go Adds OS-category request/response types + ids filter for ListOsTypes.
cloudstack/GuestOSService_mock.go Updates gomock interface to include OS-category methods/constructors.
cloudstack/ZoneService.go Extends VMware DC VM response structs with hypervisor details.
cloudstack/VPNService.go Doc comment capitalization/wording updates.
cloudstack/VPCService.go Doc comment capitalization/wording updates.
cloudstack/VolumeService.go Adds storageid param support to CreateVolume + doc comment updates.
cloudstack/VMGroupService.go Doc comment wording updates (“Instance” terminology).
cloudstack/VirtualNetworkFunctionsService.go Adds alloweddetails response field(s).
cloudstack/VirtualMachineService.go Adds params (osid, usevddk) and response field(s) (alloweddetails), plus doc comment wording updates.
cloudstack/UserService.go Doc comment wording update (“Instance” terminology).
cloudstack/UCSService.go Doc comment capitalization update.
cloudstack/TemplateService.go Doc comment capitalization/wording updates.
cloudstack/SystemVMService.go Doc comment wording updates (“System VM” terminology).
cloudstack/SSHService.go Adds alloweddetails response field + doc comment wording update.
cloudstack/SnapshotService.go Adds snapshot chain fields (parent, parentname) + doc comment wording updates.
cloudstack/ResourcemetadataService.go Doc comment wording update (“Instance” terminology).
cloudstack/ResourceIconService.go Doc comment capitalization update.
cloudstack/QuotaService.go Doc comment capitalization/wording updates.
cloudstack/ProjectService.go Doc comment capitalization updates.
cloudstack/PortableIPService.go Doc comment capitalization updates.
cloudstack/NicService.go Adds alloweddetails response field + doc comment wording update.
cloudstack/NetworkService.go Doc comment capitalization/wording updates.
cloudstack/NetworkACLService.go Doc comment capitalization + typo fix (“bettwen” → “between”).
cloudstack/NetscalerService.go Doc comment capitalization updates.
cloudstack/ManagementService.go Adds version filter param to management server list/metrics.
cloudstack/LoadBalancerService.go Doc comment wording/capitalization updates.
cloudstack/LDAPService.go Doc comment capitalization update.
cloudstack/KubernetesService.go Adds isourl field to supported version responses.
cloudstack/ISOService.go Adds alloweddetails response field + doc comment wording updates.
cloudstack/InternalLBService.go Doc comment wording updates (“Instance” terminology).
cloudstack/InfrastructureUsageService.go Doc comment capitalization update.
cloudstack/ImageStoreService.go Doc comment capitalization update.
cloudstack/HostService.go Adds details to AddSecondaryStorage params; adds version filter param to host list/metrics; doc comment wording updates.
cloudstack/FirewallService.go Doc comment wording/capitalization updates.
cloudstack/ExtensionService.go Adds reservedresourcedetails param/field to extension create/update and responses.
cloudstack/DiagnosticsService.go Doc comment wording update (“System VMs” capitalization).
cloudstack/ConsoleEndpointService.go Doc comment wording update (“Instance” terminology).
cloudstack/ConfigurationService.go Adds capability field snapshotshowchainsize.
cloudstack/CertificateService.go Doc comment wording update (“Templates” capitalization).
cloudstack/BrocadeVCSService.go Doc comment capitalization update.
cloudstack/BaremetalService.go Doc comment capitalization/wording updates.
cloudstack/BackupService.go Adds mountopts fields; adjusts backup schedule response struct; adds alloweddetails field; doc comment wording updates.
cloudstack/AutoScaleService.go Doc comment wording updates (“Instance” terminology).
cloudstack/APIDiscoveryService.go Doc comment capitalization update.
cloudstack/AnnotationService.go Doc comment capitalization updates.
cloudstack/AffinityGroupService.go Adds alloweddetails response field + doc comment wording update.
cloudstack/AddressService.go Doc comment wording/capitalization updates (“IP”, “Account”).
cloudstack/AccountService.go Doc comment wording/capitalization updates.
Files not reviewed (1)
  • cloudstack/GuestOSService_mock.go: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread generate/generate.go
Comment on lines +542 to +544
pn(" p := &QueryAsyncJobResultParams{}")
pn(" p.p = make(map[string]interface{})")
pn(" p.SetJobID(jobid)")
Comment thread cloudstack/cloudstack.go
Comment on lines +492 to +494
p := &QueryAsyncJobResultParams{}
p.p = make(map[string]interface{})
p.SetJobID(jobid)
Comment on lines +2441 to +2447
if ostypeid, ok := m["ostypeid"].(float64); ok {
m["ostypeid"] = strconv.Itoa(int(ostypeid))
b, err = json.Marshal(m)
if err != nil {
return err
}
}
}

// Create a console endpoint to connect to a VM console
// Create a console endpoint to connect to a Instance console
Comment thread cloudstack/ISOService.go
}

// Attaches an ISO to a virtual machine.
// Attaches an ISO to an Instance.
}

// Attaches a disk volume to a virtual machine.
// Attaches a disk volume to an Instance.
Comment on lines +73 to +75
"queryAsyncJobResult": {
"jobid",
},
* Adds support to upload k8s ISO from local

* update nested response

---------

Co-authored-by: Pearl Dsilva <pearl1954@gmail.com>
Copilot AI review requested due to automatic review settings August 5, 2026 08:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 54 out of 57 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • cloudstack/GuestOSService_mock.go: Generated file
  • cloudstack/KubernetesService_mock.go: Generated file
Suppressed comments (8)

generate/generate.go:1

  • The generator now emits code that instantiates QueryAsyncJobResultParams directly and mutates its internal map, bypassing the service constructor. Prefer emitting cs.Asyncjob.NewQueryAsyncJobResultParams(jobid) (or an exported constructor/helper) to avoid coupling generated code to internal struct details and to preserve any future constructor invariants.
    cloudstack/cloudstack.go:1
  • GetAsyncJobResult is now manually creating QueryAsyncJobResultParams and writing to its internal p map. Prefer using the public constructor cs.Asyncjob.NewQueryAsyncJobResultParams(jobid) to keep this code resilient to future changes in param initialization and reduce reliance on internal fields.
    test/KubernetesService_test.go:1
  • t.Errorf is printf-style; passing err.Error() directly can trigger go vet warnings (non-constant format string) and can mis-format messages containing %. Prefer t.Errorf(\"GetUploadParamsForKubernetesSupportedVersion: %v\", err) (or t.Fatalf if the test cannot continue).
    test/GuestOSService_test.go:1
  • t.Errorf is printf-style; passing err.Error() directly can trigger go vet warnings and can mis-format messages containing %. Prefer t.Errorf(\"AddOsCategory: %v\", err) (or t.Fatalf if the test cannot continue).
    cloudstack/KubernetesService.go:3742
  • The checksum parameter is serialized twice. This is redundant and makes it harder to audit generated params; remove the duplicate block so each param is set exactly once.
	if v, found := p.p["checksum"]; found {
		u.Set("checksum", v.(string))
	}
	if v, found := p.p["checksum"]; found {
		u.Set("checksum", v.(string))
	}

cloudstack/KubernetesService.go:3998

  • This method fetches upload parameters (it does not perform the upload). Update the doc comment to reflect the actual behavior (e.g., 'Gets upload parameters for a supported Kubernetes version') to avoid misleading API consumers.
// Upload a supported Kubernetes version
func (s *KubernetesService) GetUploadParamsForKubernetesSupportedVersion(p *GetUploadParamsForKubernetesSupportedVersionParams) (*GetUploadParamsForKubernetesSupportedVersionResponse, error) {
	resp, err := s.cs.newRequest("getUploadParamsForKubernetesSupportedVersion", p.toURLValues())

cloudstack/GuestOSService.go:2447

  • DeleteOsCategoryResponse does not define an ostypeid field, but UnmarshalJSON tries to coerce it. This looks like accidental leftover code and adds confusing, unnecessary work—remove the ostypeid conversion block.
	if ostypeid, ok := m["ostypeid"].(float64); ok {
		m["ostypeid"] = strconv.Itoa(int(ostypeid))
		b, err = json.Marshal(m)
		if err != nil {
			return err
		}
	}

cloudstack/LoadBalancerService.go:5734

  • There is an extra space in the comment ('list of Instances'). Consider fixing to improve generated docs readability.
// Removes an Instance or a list of  Instances from a load balancer rule.

Comment on lines +672 to +681
Id string `json:"id"`
Intervaltype string `json:"intervaltype"`
JobID string `json:"jobid"`
Jobstatus int `json:"jobstatus"`
Maxbackups int `json:"maxbackups"`
Quiescevm bool `json:"quiescevm"`
Schedule string `json:"schedule"`
Timezone string `json:"timezone"`
Virtualmachineid string `json:"virtualmachineid"`
Virtualmachinename string `json:"virtualmachinename"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants