Categorygithub.com/CiscoDevNet/go-msx-sdk
repositorypackage
1.0.11
Repository: https://github.com/ciscodevnet/go-msx-sdk.git
Documentation: pkg.go.dev

# README

Go API client for msxsdk

MSX SDK client.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.9
  • Package version: 1.0.9
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import sw "./msxsdk"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identifield by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://localhost

ClassMethodHTTP requestDescription
AuditingGenericEventsApiCreateGenericEventPost /auditing/api/v8/genericeventsCreate Generic Event
BillingCyclesApiAddBillingCyclePost /billing/api/v8/cyclesAdd a billing cycle.
BillingCyclesApiDeleteBillingCycleDelete /billing/api/v8/cycles/{id}Delete a billing cycle.
BillingCyclesApiGetBillingCycleGet /billing/api/v8/cycles/{id}Get a billing cycle.
BillingCyclesApiGetBillingCyclesPageGet /billing/api/v8/cyclesRetrieve a page of billing cycles.
BillingCyclesApiProcessBillingCyclePost /billing/api/v8/cycles/processProcess a billing cycle.
BillingCyclesApiUpdateBillingCyclePut /billing/api/v8/cycles/{id}Update billing cycle for an event type and tenant.
BillingEventsApiGetCostSummaryGet /billing/api/v8/events/costsRetrieve a summary for tenant cost.
BillingEventsApiGetEventGet /billing/api/v8/events/{id}Get an Event.
BillingEventsApiGetEventsPageGet /billing/api/v8/eventsRetrieve a page of events for tenant.
BillingPricesApiAddPricePost /billing/api/v8/pricesAdd price for tenant and event type.
BillingPricesApiDeletePriceDelete /billing/api/v8/prices/{id}Delete a price.
BillingPricesApiGetPriceGet /billing/api/v8/prices/{id}Get a price.
BillingPricesApiGetPricesPageGet /billing/api/v8/pricesRetrieve a page of prices.
BillingPricesApiUpdatePricePut /billing/api/v8/prices/{id}Update price for an event type and tenant.
DeviceTemplatesApiCreateDeviceTemplatePost /manage/api/v8/devicetemplatesCreates a device template.
DeviceTemplatesApiCreateDeviceTemplateVersionPost /manage/api/v8/devicetemplates/versionsCreates a new version of an existing device template.
DeviceTemplatesApiDeleteDeviceTemplateDelete /manage/api/v8/devicetemplates/{id}Deletes a device template.
DeviceTemplatesApiGetDeviceTemplateGet /manage/api/v8/devicetemplates/{id}Returns a device template.
DeviceTemplatesApiGetDeviceTemplatesListGet /manage/api/v8/devicetemplates/listReturns a list of device templates.
DeviceTemplatesApiScanDeviceTemplateParametersPost /manage/api/v8/devicetemplates/parameters/scanAPI to scan parameters from the device template XML.
DeviceTemplatesApiUpdateDeviceTemplateAccessPut /manage/api/v8/devicetemplates/{id}/accessUpdates device template access.
DevicesApiAttachDeviceTemplatesPost /manage/api/v8/devices/{id}/templatesAttaches one or more device templates to a device instance.
DevicesApiBatchAttachDeviceTemplatesPost /manage/api/v8/devices/templates/attachAttaches one or more device templates to a batch of device instances.
DevicesApiCreateDevicePost /manage/api/v8/devicesCreates a device.
DevicesApiDeleteDeviceDelete /manage/api/v8/devices/{id}Deletes a device.
DevicesApiDetachDeviceTemplateDelete /manage/api/v8/devices/{id}/templates/{templateId}Detaches a template from a device.
DevicesApiDetachDeviceTemplatesDelete /manage/api/v8/devices/{id}/templatesDetach device templates that are already attached to a device.
DevicesApiGetDeviceGet /manage/api/v8/devices/{id}Returns a device.
DevicesApiGetDeviceConfigGet /manage/api/v8/devices/{id}/configReturns the running configuration for a device.
DevicesApiGetDeviceTemplateHistoryGet /manage/api/v8/devices/{id}/templatesReturns device template history.
DevicesApiGetDevicesPageGet /manage/api/v8/devicesReturns a page of devices.
DevicesApiPatchDevicePatch /manage/api/v8/devices/{id}Update a device.
DevicesApiRedeployDevicePost /manage/api/v8/devices/{id}/redeployDedeploys a device.
DevicesApiUpdateDevicePut /manage/api/v8/devices/{id}Update a device.
DevicesApiUpdateDeviceTemplatesPut /manage/api/v8/devices/{id}/templatesUpdate device templates that are already attached to a device.
HealthApiGetDevicesHealthListGet /monitor/api/v8/health/devices/list
HealthApiGetServicesHealthListGet /monitor/api/v8/health/services/list
IncidentChangeRequestsApiCreateChangeRequestPost /incident/api/v8/changerequestsCreate a change request.
IncidentChangeRequestsApiDeleteChangeRequestDelete /incident/api/v8/changerequests/{id}Deletes a change request.
IncidentChangeRequestsApiGetChangeRequestGet /incident/api/v8/changerequests/{id}Returns a change request.
IncidentChangeRequestsApiGetChangeRequestsPageGet /incident/api/v8/changerequestsReturns a filtered list of change requests.
IncidentChangeRequestsApiUpdateChangeRequestPut /incident/api/v8/changerequests/{id}Updates a change request.
IncidentConfigurationsApiCreateServiceNowConfigurationPost /incident/api/v8/configurationsCreates a ServiceNow configuration.
IncidentConfigurationsApiDeleteServiceNowConfigurationDelete /incident/api/v8/configurations/{id}Deletes a ServiceNow configuration.
IncidentConfigurationsApiGetConfigurationGet /incident/api/v1/configAPI to get configuration of encloud service.
IncidentConfigurationsApiGetServiceNowConfigurationGet /incident/api/v8/configurations/{id}Returns a ServiceNow configuration.
IncidentConfigurationsApiGetServiceNowConfigurationsPageGet /incident/api/v8/configurationsReturns a ServiceNow configurations.
IncidentConfigurationsApiPatchConfigurationPatch /incident/api/v1/configAPI to patch configure encloud service
IncidentConfigurationsApiUpdateConfigurationPut /incident/api/v1/configAPI to configure encloud service.
IncidentsApiCancelIncidentPatch /incident/api/v1/incidents/{id}/cancelCancels an incident.
IncidentsApiCreateIncidentPost /incident/api/v1/incidentsCreate a new Incident.
IncidentsApiDeleteIncidentDelete /incident/api/v1/incidents/{id}Deletes an incident.
IncidentsApiGetIncidentGet /incident/api/v1/incidents/{id}Get incident details.
IncidentsApiGetIncidentsGet /incident/api/v1/incidentsGet Incidents by filter.
IncidentsApiUpdateIncidentPut /incident/api/v1/incidents/{id}Updates an incident.
LicensingAccountsApiGetUserAccountsListGet /licensing/api/v8/accounts/smart/listReturns a filtered page of smart accounts.
LicensingConfigurationsApiCreateSmartAccountConfigurationPost /licensing/api/v8/configurationCreates a smart account configuration.
LicensingConfigurationsApiGetSmartAccountConfigurationGet /licensing/api/v8/configurationReturns a smart account configuration.
LicensingConfigurationsApiUpdateSmartAccountConfigurationPut /licensing/api/v8/configurationUpdates a smart account configuration.
LicensingLicensesApiGetLicensesListGet /licensing/api/v8/licensing/api/v8/licenses/listReturns a filtered list of licenses.
OffersApiCreateOfferPost /consume/api/v8/offersCreates a product offer.
OffersApiDeleteOfferDelete /consume/api/v8/offers/{id}Deletes a product offer
OffersApiGetOfferGet /consume/api/v8/offers/{id}Returns a product offer.
OffersApiGetOfferAssignmentsListGet /consume/api/v8/offers/{id}/assignments/listReturns a list of tenant assignments for a product offer.
OffersApiGetOffersCountGet /consume/api/v8/offers/countReturns the number of product offers.
OffersApiGetOffersPageGet /consume/api/v8/offersReturns a page of product offers.
OffersApiUpdateOfferPut /consume/api/v8/offers/{id}Updates a product offer.
OffersApiUpdateOfferAssignmentsPut /consume/api/v8/offers/{id}/assignmentsUpdates the tenant assignemnts for a product offer.
ProductsApiCreateProductPost /consume/api/v8/productsCreates a product.
ProductsApiDeleteProductDelete /consume/api/v8/products/{id}Deletes a product.
ProductsApiGetProductGet /consume/api/v8/products/{id}Returns a product.
ProductsApiGetProductAssignmentsListGet /consume/api/v8/products/{id}/assignments/listReturns a list of tenant assignments for a product .
ProductsApiGetProductsCountGet /consume/api/v8/products/countReturns the number of products.
ProductsApiGetProductsPageGet /consume/api/v8/productsReturns a page of products.
ProductsApiUpdateProductPut /consume/api/v8/products/{id}Updates a product.
ProductsApiUpdateProductAssignmentsPut /consume/api/v8/products/{id}/assignmentsUpdates the tenant assignments for a product.
RegistrationApiDeleteRegisteredProductVersionDelete /vulnerability/api/v8/vulnerabilities/registrations/{id}Delete a registration.
RegistrationApiGetRegisteredProductVersionPageGet /vulnerability/api/v8/vulnerabilities/registrationsReturns a filtered page of registered products / versions.
RegistrationApiRegisterProductVersionPost /vulnerability/api/v8/vulnerabilities/registrationsRegister a product / verison combination for vulnerability inspection.
RolesApiGetRoleByNameGet /idm/api/v8/roles/name/{name}Returns a role by name.
RolesApiGetRolesListGet /idm/api/v8/roles/listReturns a list of roles.
SecurityApiGetAccessTokenPost /idm/v2/tokenReturns an access token.
ServicesApiDeleteServiceDelete /manage/api/v8/services/{id}Deletes a service.
ServicesApiGetServiceGet /manage/api/v8/services/{id}Returns a service.
ServicesApiGetServicesPageGet /manage/api/v8/servicesReturns a page of services.
ServicesApiSubmitOrderPost /manage/api/v8/servicesSubmits an order.
ServicesApiUpdateOrderPut /manage/api/v8/servicesUpdates an order.
ServicesApiUpdateServicePut /manage/api/v8/services/{id}Updates a service.
SitesApiAddDevicesToSitePost /manage/api/v8/sites/{id}/devices/addAdd devices to a site.
SitesApiAddServicesToSitePost /manage/api/v8/sites/{id}/services/addAdd services to a site.
SitesApiCreateSitePost /manage/api/v8/sitesCreates a new site.
SitesApiDeleteSiteDelete /manage/api/v8/sites/{id}Deletes a site.
SitesApiGetSiteGet /manage/api/v8/sites/{id}Returns a site.
SitesApiGetSitesPageGet /manage/api/v8/sitesReturns a page of Sites. Only one filter is supported at a time.
SitesApiRemoveDevicesFromSitePost /manage/api/v8/sites/{id}/devices/removeRemoves devices from a site.
SitesApiRemoveServicesFromSitePost /manage/api/v8/sites/{id}/services/removeRemove services from a site.
SitesApiUpdateSitePut /manage/api/v8/sites/{id}Updates a site.
TemplateApplicationsApiApplyTemplatePost /template/api/v8/templates/{id}/applicationsApplies a template to a target.
TemplateApplicationsApiDeleteTemplateApplicationDelete /template/api/v8/templates/applications/{id}Deletes a template application.
TemplateApplicationsApiGetTemplateApplicationGet /template/api/v8/templates/applications/{id}Gets a template application.
TemplateApplicationsApiGetTemplateApplicationHistoryGet /template/api/v8/templates/applications/{id}/historyGets a template application history.
TemplateApplicationsApiGetTemplateApplicationsPageGet /template/api/v8/templates/applicationsGet a page of template applications.
TemplateApplicationsApiUpdateApplicationStatusPatch /template/api/v8/templates/applications/{id}Updates an application status.
TemplateAssignmentsApiBatchAssignTemplatePost /template/api/v8/templates/{id}/assignments/addAssigns a template to one or more tenants.
TemplateAssignmentsApiBatchUnassignTemplatePost /template/api/v8/templates/{id}/assignments/removeUnassigns a template from one or more tenants.
TemplateAssignmentsApiGetAssignmentGet /template/api/v8/templates/assignments/{id}Gets a template assignment.
TemplateAssignmentsApiGetAssignmentHistoryGet /template/api/v8/templates/assignments/{id}/historyGets a template assignment history.
TemplateAssignmentsApiGetTemplateAssignmentsPageGet /template/api/v8/templates/assignmentsReturns a page of template assignments.
TemplateAssignmentsApiUpdateAssignmentStatusPatch /template/api/v8/templates/assignments/{id}Updates a template assignment status.
TemplatesApiDeleteTemplateDelete /template/api/v8/templates/{id}Deletes a template.
TemplatesApiGetTemplateGet /template/api/v8/templates/{id}Returns a template by id.
TemplatesApiGetTemplateHistoryGet /template/api/v8/templates/{id}/historyReturns a template history by id.
TemplatesApiGetTemplatesPageGet /template/api/v8/templatesReturns a page of templates.
TemplatesApiImportTemplatePost /template/api/v8/templatesImports a template.
TemplatesApiUpdateTemplateStatusPatch /template/api/v8/templates/{id}Updates a template status.
TenantsApiCreateTenantPost /idm/api/v8/tenantsCreates a new tenant.
TenantsApiDeleteTenantDelete /idm/api/v8/tenants/{id}Deletes a tenant by id.
TenantsApiGetTenantGet /idm/api/v8/tenants/{id}Returns a tenant by id.
TenantsApiGetTenantsListGet /idm/api/v8/tenants/listReturns a list of tenants.
TenantsApiGetTenantsPageGet /idm/api/v8/tenantsReturns a page of tenants.
TenantsApiUpdateTenantPut /idm/api/v8/tenants/{id}Updates a tenant by id.
UsersApiCreateUserPost /idm/api/v8/usersCreates a new user.
UsersApiDeleteUserDelete /idm/api/v8/users/{id}Deletes a user by id.
UsersApiGetCurrentUserGet /idm/api/v8/users/currentReturns the current user.
UsersApiGetUserGet /idm/api/v8/users/{id}Returns an existing user.
UsersApiGetUsersPageGet /idm/api/v8/usersReturns a page of users.
UsersApiUpdateUserPut /idm/api/v8/users/{id}Updates an existing user.
UsersApiUpdateUserPasswordPut /idm/api/v8/users/updatepasswordUpdate a user password.
ValidationApiGetValidateProductVersionPageGet /vulnerability/api/v8/vulnerabilities/validationsReturns a filtered page of validations.
ValidationApiValidateProductVersionPost /vulnerability/api/v8/vulnerabilities/validationsValidate registered product / verison combinations for vulnerabilities.
VulnerabilitiesApiGetIngestVulnerabilitiesTasksPageGet /vulnerability/api/v8/vulnerabilities/ingestsReturns a filtered page of ingest tasks.
VulnerabilitiesApiGetVulnerabilitiesPageGet /vulnerability/api/v8/vulnerabilitiesReturns a filtered page of vulnerabilities.
VulnerabilitiesApiIngestVulnerabilitiesPost /vulnerability/api/v8/vulnerabilities/ingestsIngests a CVE JSON feed into the Vulnerability Service datastore.
WorkflowCategoriesApiCreateWorkflowCategoryPost /workflow/api/v8/categoriesCreates a new workflow category.
WorkflowCategoriesApiDeleteWorkflowCategoryDelete /workflow/api/v8/categories/{id}Deletes a workflow category.
WorkflowCategoriesApiGetWorkflowCategoriesListGet /workflow/api/v8/categories/listReturns a list of workflow categories.
WorkflowCategoriesApiGetWorkflowCategoryGet /workflow/api/v8/categories/{id}Returns a workflow category.
WorkflowCategoriesApiUpdateWorkflowCategoryPut /workflow/api/v8/categories/{id}Updates a workflow category.
WorkflowEventsApiCreateWorkflowEventPost /workflow/api/v8/eventsCreates a new workflow event.
WorkflowEventsApiDeleteWorkflowEventDelete /workflow/api/v8/events/{id}Deletes a workflow event.
WorkflowEventsApiGetWorkflowEventGet /workflow/api/v8/events/{id}Returns a workflow event.
WorkflowEventsApiGetWorkflowEventsListGet /workflow/api/v8/events/listReturns a list of workflow events.
WorkflowEventsApiUpdateWorkflowEventPut /workflow/api/v8/events/{id}Updates a workflow event.
WorkflowInstancesApiCancelWorkflowInstancePost /workflow/api/v8/workflows/instances/{id}/cancelCancels a workflow instance.
WorkflowInstancesApiDeleteWorkflowInstanceDelete /workflow/api/v8/workflows/instances/{id}Deletes a workflow instance.
WorkflowInstancesApiGetWorkflowInstanceGet /workflow/api/v8/workflows/instances/{id}Returns a workflow instance.
WorkflowInstancesApiGetWorkflowInstanceActionGet /workflow/api/v8/workflows/instances/{id}/actions/{actionId}Returns a workflow instance action.
WorkflowInstancesApiGetWorkflowInstancesListGet /workflow/api/v8/workflows/{id}/instances/listReturns a list of workflow instances.
WorkflowSchemasApiGetWorkflowSchemaGet /workflow/api/v8/schemas/{id}Returns a workflow schema.
WorkflowSchemasApiGetWorkflowSchemasListGet /workflow/api/v8/schemas/listReturns a list of workflow schemas.
WorkflowTargetsApiCreateWorkflowTargetPost /workflow/api/v8/targetsCreates a new workflow target.
WorkflowTargetsApiDeleteWorkflowTargetDelete /workflow/api/v8/targets/{id}Deletes a workflow target.
WorkflowTargetsApiGetWorkflowTargetGet /workflow/api/v8/targets/{id}Returns a workflow target.
WorkflowTargetsApiGetWorkflowTargetsListGet /workflow/api/v8/targets/listReturns a list of workflow targets.
WorkflowTargetsApiUpdateWorkflowTargetPut /workflow/api/v8/targets/{id}Updates a workflow target.
WorkflowsApiDeleteWorkflowDelete /workflow/api/v8/workflows/{id}Delete a workflow.
WorkflowsApiExportWorkflowGet /workflow/api/v8/workflows/{id}/exportExports a workflow.
WorkflowsApiGetWorkflowGet /workflow/api/v8/workflows/{id}Returns a workflow.
WorkflowsApiGetWorkflowStartConfigGet /workflow/api/v8/workflows/{id}/startconfigReturns a workflow start config.
WorkflowsApiGetWorkflowsListGet /workflow/api/v8/workflows/listReturns a list of workflows.
WorkflowsApiImportWorkflowPost /workflow/api/v8/workflowsImports a workflow.
WorkflowsApiStartWorkflowPost /workflow/api/v8/workflows/{id}/startStarts a workflow.
WorkflowsApiUpdateWorkflowPut /workflow/api/v8/workflows/{id}Updates a workflow.
WorkflowsApiValidateWorkflowPost /workflow/api/v8/workflows/{id}/validateValidates a workflow.

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author