Skip to content

CiscoDevNet/go-msx-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.10
  • Package version: 1.0.10
  • 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 msxsdk "github.com/GIT_USER_ID/GIT_REPO_ID"

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(), msxsdk.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(), msxsdk.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 identified 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(), msxsdk.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), msxsdk.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
AuditingGenericEventsApi CreateGenericEvent Post /auditing/api/v8/genericevents Create Generic Event
BillingCyclesApi AddBillingCycle Post /billing/api/v8/cycles Add a billing cycle.
BillingCyclesApi DeleteBillingCycle Delete /billing/api/v8/cycles/{id} Delete a billing cycle.
BillingCyclesApi GetBillingCycle Get /billing/api/v8/cycles/{id} Get a billing cycle.
BillingCyclesApi GetBillingCyclesPage Get /billing/api/v8/cycles Retrieve a page of billing cycles.
BillingCyclesApi ProcessBillingCycle Post /billing/api/v8/cycles/process Process a billing cycle.
BillingCyclesApi UpdateBillingCycle Put /billing/api/v8/cycles/{id} Update billing cycle for an event type and tenant.
BillingEventsApi GetCostSummary Get /billing/api/v8/events/costs Retrieve a summary for tenant cost.
BillingEventsApi GetEvent Get /billing/api/v8/events/{id} Get an Event.
BillingEventsApi GetEventsPage Get /billing/api/v8/events Retrieve a page of events for tenant.
BillingPricesApi AddPrice Post /billing/api/v8/prices Add price for tenant and event type.
BillingPricesApi DeletePrice Delete /billing/api/v8/prices/{id} Delete a price.
BillingPricesApi GetPrice Get /billing/api/v8/prices/{id} Get a price.
BillingPricesApi GetPricesPage Get /billing/api/v8/prices Retrieve a page of prices.
BillingPricesApi UpdatePrice Put /billing/api/v8/prices/{id} Update price for an event type and tenant.
DeviceTemplatesApi CreateDeviceTemplate Post /manage/api/v8/devicetemplates Creates a device template.
DeviceTemplatesApi CreateDeviceTemplateVersion Post /manage/api/v8/devicetemplates/versions Creates a new version of an existing device template.
DeviceTemplatesApi DeleteDeviceTemplate Delete /manage/api/v8/devicetemplates/{id} Deletes a device template.
DeviceTemplatesApi GetDeviceTemplate Get /manage/api/v8/devicetemplates/{id} Returns a device template.
DeviceTemplatesApi GetDeviceTemplatesList Get /manage/api/v8/devicetemplates/list Returns a list of device templates.
DeviceTemplatesApi ScanDeviceTemplateParameters Post /manage/api/v8/devicetemplates/parameters/scan API to scan parameters from the device template XML.
DeviceTemplatesApi UpdateDeviceTemplateAccess Put /manage/api/v8/devicetemplates/{id}/access Updates device template access.
DevicesApi AttachDeviceTemplates Post /manage/api/v8/devices/{id}/templates Attaches one or more device templates to a device instance.
DevicesApi BatchAttachDeviceTemplates Post /manage/api/v8/devices/templates/attach Attaches one or more device templates to a batch of device instances.
DevicesApi CreateDevice Post /manage/api/v8/devices Creates a device.
DevicesApi DeleteDevice Delete /manage/api/v8/devices/{id} Deletes a device.
DevicesApi DetachDeviceTemplate Delete /manage/api/v8/devices/{id}/templates/{templateId} Detaches a template from a device.
DevicesApi DetachDeviceTemplates Delete /manage/api/v8/devices/{id}/templates Detach device templates that are already attached to a device.
DevicesApi GetDevice Get /manage/api/v8/devices/{id} Returns a device.
DevicesApi GetDeviceConfig Get /manage/api/v8/devices/{id}/config Returns the running configuration for a device.
DevicesApi GetDeviceTemplateHistory Get /manage/api/v8/devices/{id}/templates Returns device template history.
DevicesApi GetDevicesPage Get /manage/api/v8/devices Returns a page of devices.
DevicesApi PatchDevice Patch /manage/api/v8/devices/{id} Update a device.
DevicesApi RedeployDevice Post /manage/api/v8/devices/{id}/redeploy Dedeploys a device.
DevicesApi UpdateDevice Put /manage/api/v8/devices/{id} Update a device.
DevicesApi UpdateDeviceConfig Post /manage/api/v8/devices/{id}/config/update push device configuration to the actual device
DevicesApi UpdateDeviceTemplates Put /manage/api/v8/devices/{id}/templates Update device templates that are already attached to a device.
HealthApi GetDevicesHealthList Get /monitor/api/v8/health/devices/list
HealthApi GetServicesHealthList Get /monitor/api/v8/health/services/list
IncidentChangeRequestsApi CreateChangeRequest Post /incident/api/v8/changerequests Create a change request.
IncidentChangeRequestsApi DeleteChangeRequest Delete /incident/api/v8/changerequests/{id} Deletes a change request.
IncidentChangeRequestsApi GetChangeRequest Get /incident/api/v8/changerequests/{id} Returns a change request.
IncidentChangeRequestsApi GetChangeRequestsPage Get /incident/api/v8/changerequests Returns a filtered list of change requests.
IncidentChangeRequestsApi UpdateChangeRequest Put /incident/api/v8/changerequests/{id} Updates a change request.
IncidentConfigurationsApi CreateServiceNowConfiguration Post /incident/api/v8/configurations Creates a ServiceNow configuration.
IncidentConfigurationsApi DeleteServiceNowConfiguration Delete /incident/api/v8/configurations/{id} Deletes a ServiceNow configuration.
IncidentConfigurationsApi GetConfiguration Get /incident/api/v1/config API to get configuration of encloud service.
IncidentConfigurationsApi GetServiceNowConfiguration Get /incident/api/v8/configurations/{id} Returns a ServiceNow configuration.
IncidentConfigurationsApi GetServiceNowConfigurationsPage Get /incident/api/v8/configurations Returns a ServiceNow configurations.
IncidentConfigurationsApi PatchConfiguration Patch /incident/api/v1/config API to patch configure encloud service
IncidentConfigurationsApi UpdateConfiguration Put /incident/api/v1/config API to configure encloud service.
IncidentsApi CancelIncident Patch /incident/api/v1/incidents/{id}/cancel Cancels an incident.
IncidentsApi CreateIncident Post /incident/api/v1/incidents Create a new Incident.
IncidentsApi DeleteIncident Delete /incident/api/v1/incidents/{id} Deletes an incident.
IncidentsApi GetIncident Get /incident/api/v1/incidents/{id} Get incident details.
IncidentsApi GetIncidents Get /incident/api/v1/incidents Get Incidents by filter.
IncidentsApi UpdateIncident Put /incident/api/v1/incidents/{id} Updates an incident.
LicensingAccountsApi GetUserAccountsList Get /licensing/api/v8/accounts/smart/list Returns a filtered page of smart accounts.
LicensingConfigurationsApi CreateSmartAccountConfiguration Post /licensing/api/v8/configuration Creates a smart account configuration.
LicensingConfigurationsApi GetSmartAccountConfiguration Get /licensing/api/v8/configuration Returns a smart account configuration.
LicensingConfigurationsApi UpdateSmartAccountConfiguration Put /licensing/api/v8/configuration Updates a smart account configuration.
LicensingLicensesApi GetLicensesList Get /licensing/api/v8/licensing/api/v8/licenses/list Returns a filtered list of licenses.
OffersApi CreateOffer Post /consume/api/v8/offers Creates a product offer.
OffersApi DeleteOffer Delete /consume/api/v8/offers/{id} Deletes a product offer
OffersApi GetOffer Get /consume/api/v8/offers/{id} Returns a product offer.
OffersApi GetOfferAssignmentsList Get /consume/api/v8/offers/{id}/assignments/list Returns a list of tenant assignments for a product offer.
OffersApi GetOffersCount Get /consume/api/v8/offers/count Returns the number of product offers.
OffersApi GetOffersPage Get /consume/api/v8/offers Returns a page of product offers.
OffersApi UpdateOffer Put /consume/api/v8/offers/{id} Updates a product offer.
OffersApi UpdateOfferAssignments Put /consume/api/v8/offers/{id}/assignments Updates the tenant assignemnts for a product offer.
ProductsApi CreateProduct Post /consume/api/v8/products Creates a product.
ProductsApi DeleteProduct Delete /consume/api/v8/products/{id} Deletes a product.
ProductsApi GetProduct Get /consume/api/v8/products/{id} Returns a product.
ProductsApi GetProductAssignmentsList Get /consume/api/v8/products/{id}/assignments/list Returns a list of tenant assignments for a product .
ProductsApi GetProductsCount Get /consume/api/v8/products/count Returns the number of products.
ProductsApi GetProductsPage Get /consume/api/v8/products Returns a page of products.
ProductsApi UpdateProduct Put /consume/api/v8/products/{id} Updates a product.
ProductsApi UpdateProductAssignments Put /consume/api/v8/products/{id}/assignments Updates the tenant assignments for a product.
RegistrationApi DeleteRegisteredProductVersion Delete /vulnerability/api/v8/vulnerabilities/registrations/{id} Delete a registration.
RegistrationApi GetRegisteredProductVersionPage Get /vulnerability/api/v8/vulnerabilities/registrations Returns a filtered page of registered products / versions.
RegistrationApi RegisterProductVersion Post /vulnerability/api/v8/vulnerabilities/registrations Register a product / verison combination for vulnerability inspection.
RolesApi GetRoleByName Get /idm/api/v8/roles/name/{name} Returns a role by name.
RolesApi GetRolesList Get /idm/api/v8/roles/list Returns a list of roles.
SecurityApi GetAccessToken Post /idm/v2/token Returns an access token.
ServicesApi DeleteService Delete /manage/api/v8/services/{id} Deletes a service.
ServicesApi GetService Get /manage/api/v8/services/{id} Returns a service.
ServicesApi GetServicesPage Get /manage/api/v8/services Returns a page of services.
ServicesApi SubmitOrder Post /manage/api/v8/services Submits an order.
ServicesApi UpdateOrder Put /manage/api/v8/services Updates an order.
ServicesApi UpdateService Put /manage/api/v8/services/{id} Updates a service.
SitesApi AddDevicesToSite Post /manage/api/v8/sites/{id}/devices/add Add devices to a site.
SitesApi AddServicesToSite Post /manage/api/v8/sites/{id}/services/add Add services to a site.
SitesApi CreateSite Post /manage/api/v8/sites Creates a new site.
SitesApi DeleteSite Delete /manage/api/v8/sites/{id} Deletes a site.
SitesApi GetSite Get /manage/api/v8/sites/{id} Returns a site.
SitesApi GetSitesPage Get /manage/api/v8/sites Returns a page of Sites. Only one filter is supported at a time.
SitesApi RemoveDevicesFromSite Post /manage/api/v8/sites/{id}/devices/remove Removes devices from a site.
SitesApi RemoveServicesFromSite Post /manage/api/v8/sites/{id}/services/remove Remove services from a site.
SitesApi UpdateSite Put /manage/api/v8/sites/{id} Updates a site.
TemplateApplicationsApi ApplyTemplate Post /template/api/v8/templates/{id}/applications Applies a template to a target.
TemplateApplicationsApi DeleteTemplateApplication Delete /template/api/v8/templates/applications/{id} Deletes a template application.
TemplateApplicationsApi GetTemplateApplication Get /template/api/v8/templates/applications/{id} Gets a template application.
TemplateApplicationsApi GetTemplateApplicationHistory Get /template/api/v8/templates/applications/{id}/history Gets a template application history.
TemplateApplicationsApi GetTemplateApplicationsPage Get /template/api/v8/templates/applications Get a page of template applications.
TemplateApplicationsApi UpdateApplicationStatus Patch /template/api/v8/templates/applications/{id} Updates an application status.
TemplateAssignmentsApi BatchAssignTemplate Post /template/api/v8/templates/{id}/assignments/add Assigns a template to one or more tenants.
TemplateAssignmentsApi BatchUnassignTemplate Post /template/api/v8/templates/{id}/assignments/remove Unassigns a template from one or more tenants.
TemplateAssignmentsApi GetAssignment Get /template/api/v8/templates/assignments/{id} Gets a template assignment.
TemplateAssignmentsApi GetAssignmentHistory Get /template/api/v8/templates/assignments/{id}/history Gets a template assignment history.
TemplateAssignmentsApi GetTemplateAssignmentsPage Get /template/api/v8/templates/assignments Returns a page of template assignments.
TemplateAssignmentsApi UpdateAssignmentStatus Patch /template/api/v8/templates/assignments/{id} Updates a template assignment status.
TemplatesApi DeleteTemplate Delete /template/api/v8/templates/{id} Deletes a template.
TemplatesApi GetTemplate Get /template/api/v8/templates/{id} Returns a template by id.
TemplatesApi GetTemplateHistory Get /template/api/v8/templates/{id}/history Returns a template history by id.
TemplatesApi GetTemplatesPage Get /template/api/v8/templates Returns a page of templates.
TemplatesApi ImportTemplate Post /template/api/v8/templates Imports a template.
TemplatesApi UpdateTemplateStatus Patch /template/api/v8/templates/{id} Updates a template status.
TenantsApi CreateTenant Post /idm/api/v8/tenants Creates a new tenant.
TenantsApi DeleteTenant Delete /idm/api/v8/tenants/{id} Deletes a tenant by id.
TenantsApi GetTenant Get /idm/api/v8/tenants/{id} Returns a tenant by id.
TenantsApi GetTenantByExternalId Get /idm/api/v8/tenants/externalId/{externalId} Returns a tenant by externalId.
TenantsApi GetTenantsList Get /idm/api/v8/tenants/list Returns a list of tenants.
TenantsApi GetTenantsPage Get /idm/api/v8/tenants Returns a page of tenants.
TenantsApi UpdateTenant Put /idm/api/v8/tenants/{id} Updates a tenant by id.
UsersApi CreateUser Post /idm/api/v8/users Creates a new user.
UsersApi DeleteUser Delete /idm/api/v8/users/{id} Deletes a user by id.
UsersApi GetCurrentUser Get /idm/api/v8/users/current Returns the current user.
UsersApi GetUser Get /idm/api/v8/users/{id} Returns an existing user.
UsersApi GetUsersPage Get /idm/api/v8/users Returns a page of users.
UsersApi UpdateUser Put /idm/api/v8/users/{id} Updates an existing user.
UsersApi UpdateUserPassword Put /idm/api/v8/users/updatepassword Update a user password.
ValidationApi GetValidateProductVersionPage Get /vulnerability/api/v8/vulnerabilities/validations Returns a filtered page of validations.
ValidationApi ValidateProductVersion Post /vulnerability/api/v8/vulnerabilities/validations Validate registered product / verison combinations for vulnerabilities.
VulnerabilitiesApi GetIngestVulnerabilitiesTasksPage Get /vulnerability/api/v8/vulnerabilities/ingests Returns a filtered page of ingest tasks.
VulnerabilitiesApi GetVulnerabilitiesPage Get /vulnerability/api/v8/vulnerabilities Returns a filtered page of vulnerabilities.
VulnerabilitiesApi IngestVulnerabilities Post /vulnerability/api/v8/vulnerabilities/ingests Ingests a CVE JSON feed into the Vulnerability Service datastore.
WorkflowCategoriesApi CreateWorkflowCategory Post /workflow/api/v8/categories Creates a new workflow category.
WorkflowCategoriesApi DeleteWorkflowCategory Delete /workflow/api/v8/categories/{id} Deletes a workflow category.
WorkflowCategoriesApi GetWorkflowCategoriesList Get /workflow/api/v8/categories/list Returns a list of workflow categories.
WorkflowCategoriesApi GetWorkflowCategory Get /workflow/api/v8/categories/{id} Returns a workflow category.
WorkflowCategoriesApi UpdateWorkflowCategory Put /workflow/api/v8/categories/{id} Updates a workflow category.
WorkflowEventsApi CreateWorkflowEvent Post /workflow/api/v8/events Creates a new workflow event.
WorkflowEventsApi DeleteWorkflowEvent Delete /workflow/api/v8/events/{id} Deletes a workflow event.
WorkflowEventsApi GetWorkflowEvent Get /workflow/api/v8/events/{id} Returns a workflow event.
WorkflowEventsApi GetWorkflowEventsList Get /workflow/api/v8/events/list Returns a list of workflow events.
WorkflowEventsApi UpdateWorkflowEvent Put /workflow/api/v8/events/{id} Updates a workflow event.
WorkflowInstancesApi CancelWorkflowInstance Post /workflow/api/v8/workflows/instances/{id}/cancel Cancels a workflow instance.
WorkflowInstancesApi DeleteWorkflowInstance Delete /workflow/api/v8/workflows/instances/{id} Deletes a workflow instance.
WorkflowInstancesApi GetWorkflowInstance Get /workflow/api/v8/workflows/instances/{id} Returns a workflow instance.
WorkflowInstancesApi GetWorkflowInstanceAction Get /workflow/api/v8/workflows/instances/{id}/actions/{actionId} Returns a workflow instance action.
WorkflowInstancesApi GetWorkflowInstancesList Get /workflow/api/v8/workflows/{id}/instances/list Returns a list of workflow instances.
WorkflowSchemasApi GetWorkflowSchema Get /workflow/api/v8/schemas/{id} Returns a workflow schema.
WorkflowSchemasApi GetWorkflowSchemasList Get /workflow/api/v8/schemas/list Returns a list of workflow schemas.
WorkflowTargetsApi CreateWorkflowTarget Post /workflow/api/v8/targets Creates a new workflow target.
WorkflowTargetsApi DeleteWorkflowTarget Delete /workflow/api/v8/targets/{id} Deletes a workflow target.
WorkflowTargetsApi GetWorkflowTarget Get /workflow/api/v8/targets/{id} Returns a workflow target.
WorkflowTargetsApi GetWorkflowTargetsList Get /workflow/api/v8/targets/list Returns a list of workflow targets.
WorkflowTargetsApi UpdateWorkflowTarget Put /workflow/api/v8/targets/{id} Updates a workflow target.
WorkflowsApi DeleteWorkflow Delete /workflow/api/v8/workflows/{id} Delete a workflow.
WorkflowsApi ExportWorkflow Get /workflow/api/v8/workflows/{id}/export Exports a workflow.
WorkflowsApi GetWorkflow Get /workflow/api/v8/workflows/{id} Returns a workflow.
WorkflowsApi GetWorkflowStartConfig Get /workflow/api/v8/workflows/{id}/startconfig Returns a workflow start config.
WorkflowsApi GetWorkflowsList Get /workflow/api/v8/workflows/list Returns a list of workflows.
WorkflowsApi ImportWorkflow Post /workflow/api/v8/workflows Imports a workflow.
WorkflowsApi StartWorkflow Post /workflow/api/v8/workflows/{id}/start Starts a workflow.
WorkflowsApi UpdateWorkflow Put /workflow/api/v8/workflows/{id} Updates a workflow.
WorkflowsApi ValidateWorkflow Post /workflow/api/v8/workflows/{id}/validate Validates 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