package
0.0.2
Repository: https://github.com/runzeroinc/runzero-api.git
Documentation: pkg.go.dev

# README

Go API client for openapi

runZero Network Discovery API

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.4
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientExperimentalCodegen

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 "./openapi"

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 https://console.runzero.com/api/v1.0

ClassMethodHTTP requestDescription
ExportApiExportAssetSyncCreatedJSONGet /export/org/assets/sync/created/assets.jsonExports the asset inventory in a sync-friendly manner using created_at as a checkpoint.
ExportApiExportAssetSyncUpdatedJSONGet /export/org/assets/sync/updated/assets.jsonExports the asset inventory in a sync-friendly manner using updated_at as a checkpoint.
ExportApiExportAssetsCSVGet /export/org/assets.csvAsset inventory as CSV.
ExportApiExportAssetsJSONGet /export/org/assets.jsonExports the asset inventory.
ExportApiExportAssetsJSONLGet /export/org/assets.jsonlAsset inventory as JSON line-delimited.
ExportApiExportAssetsNmapXMLGet /export/org/assets.nmap.xmlAsset inventory as Nmap-style XML.
ExportApiExportServicesCSVGet /export/org/services.csvService inventory as CSV.
ExportApiExportServicesJSONGet /export/org/services.jsonService inventory as JSON.
ExportApiExportServicesJSONLGet /export/org/services.jsonlService inventory as JSON line-delimited.
ExportApiExportSitesCSVGet /export/org/sites.csvSite list as CSV.
ExportApiExportSitesJSONGet /export/org/sites.jsonExport all sites.
ExportApiExportSitesJSONLGet /export/org/sites.jsonlSite list as JSON line-delimited.
ExportApiExportWirelessCSVGet /export/org/wireless.csvWireless inventory as CSV.
ExportApiExportWirelessJSONGet /export/org/wireless.jsonWireless inventory as JSON.
ExportApiExportWirelessJSONLGet /export/org/wireless.jsonlWireless inventory as JSON line-delimited.
OrganizationApiCreateScanPut /org/sites/{site_id}/scanCreate a scan task for a given site.
OrganizationApiCreateSitePut /org/sitesCreate a new site.
OrganizationApiGetAgentGet /org/agents/{agent_id}Get details for a single agent.
OrganizationApiGetAgentsGet /org/agentsGet all agents.
OrganizationApiGetAssetGet /org/assets/{asset_id}Get asset details.
OrganizationApiGetAssetsGet /org/assetsGet all assets.
OrganizationApiGetKeyGet /org/keyGet API key details.
OrganizationApiGetOrganizationGet /orgGet organization details.
OrganizationApiGetServiceGet /org/services/{service_id}Get service details.
OrganizationApiGetServicesGet /org/servicesGet all services.
OrganizationApiGetSiteGet /org/sites/{site_id}Get site details.
OrganizationApiGetSitesGet /org/sitesGet all sites.
OrganizationApiGetTaskGet /org/tasks/{task_id}Get task details.
OrganizationApiGetTaskChangeReportGet /org/tasks/{task_id}/changesReturns a temporary task change report data url.
OrganizationApiGetTaskScanDataGet /org/tasks/{task_id}/dataReturns a temporary task scan data url.
OrganizationApiGetTasksGet /org/tasksGet all tasks (last 1000).
OrganizationApiGetWirelessLANGet /org/wirelesss/{wireless_id}Get wireless LAN details.
OrganizationApiGetWirelessLANsGet /org/wirelessGet all wireless LANs.
OrganizationApiHideTaskPost /org/tasks/{task_id}/hideSignal that a completed task should be hidden.
OrganizationApiImportScanDataPut /org/sites/{site_id}/importImport a scan data file into a site.
OrganizationApiRemoveAgentDelete /org/agents/{agent_id}Remove and uninstall an agent.
OrganizationApiRemoveAssetDelete /org/assets/{asset_id}Remove an asset.
OrganizationApiRemoveServiceDelete /org/services/{service_id}Remove a service.
OrganizationApiRemoveSiteDelete /org/sites/{site_id}Remove a site and associated assets.
OrganizationApiRemoveWirelessLANDelete /org/wirelesss/{wireless_id}Remove a wireless LAN.
OrganizationApiStopTaskPost /org/tasks/{task_id}/stopSignal that a task should be stopped or canceled.
OrganizationApiUpdateAgentSitePatch /org/agents/{agent_id}Update the site associated with agent.
OrganizationApiUpdateAssetCommentsPatch /org/assets/{asset_id}/commentsUpdate asset comments.
OrganizationApiUpdateAssetTagsPatch /org/assets/{asset_id}/tagsUpdate asset tags.
OrganizationApiUpdateOrganizationPatch /orgUpdate organization details.
OrganizationApiUpdateSitePatch /org/sites/{site_id}Update a site definition.
OrganizationApiUpdateTaskPatch /org/tasks/{task_id}Update task parameters.
OrganizationApiUpgradeAgentPost /org/agents/{agent_id}/updateForce an agent to update and restart.
PublicApiGetLatestAgentVersionGet /releases/agent/versionReturns latest agent version.
PublicApiGetLatestPlatformVersionGet /releases/platform/versionReturns latest platform version.
PublicApiGetLatestScannerVersionGet /releases/scanner/versionReturns latest scanner version.

Documentation For Models

Documentation For Authorization

bearerAuth

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

[email protected]

# Packages

No description provided by the author

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
NewAgent instantiates a new Agent object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAgentSiteID instantiates a new AgentSiteID object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAgentSiteIDWithDefaults instantiates a new AgentSiteID object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAgentWithDefaults instantiates a new Agent object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAPIClient creates a new API client.
NewAPIResponse returns a new APIResonse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewAsset instantiates a new Asset object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAssetComments instantiates a new AssetComments object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAssetCommentsWithDefaults instantiates a new AssetComments object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAssetsWithCheckpoint instantiates a new AssetsWithCheckpoint object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAssetsWithCheckpointWithDefaults instantiates a new AssetsWithCheckpoint object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAssetTags instantiates a new AssetTags object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAssetTagsWithDefaults instantiates a new AssetTags object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAssetWithDefaults instantiates a new Asset object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewComponentVersion instantiates a new ComponentVersion object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewComponentVersionWithDefaults instantiates a new ComponentVersion object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConfiguration returns a new Configuration object.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewOrganization instantiates a new Organization object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewOrganizationWithDefaults instantiates a new Organization object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewOrgOptions instantiates a new OrgOptions object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewOrgOptionsWithDefaults instantiates a new OrgOptions object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewRunZeroAPIKey instantiates a new RunZeroAPIKey object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewRunZeroAPIKeyWithDefaults instantiates a new RunZeroAPIKey object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewScanOptions instantiates a new ScanOptions object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewScanOptionsWithDefaults instantiates a new ScanOptions object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewService instantiates a new Service object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewServiceWithDefaults instantiates a new Service object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewSite instantiates a new Site object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewSiteOptions instantiates a new SiteOptions object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewSiteOptionsWithDefaults instantiates a new SiteOptions object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewSiteWithDefaults instantiates a new Site object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewTask instantiates a new Task object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewTaskWithDefaults instantiates a new Task object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewURL instantiates a new URL object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewURLWithDefaults instantiates a new URL object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewWireless instantiates a new Wireless object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewWirelessWithDefaults instantiates a new Wireless object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
PtrBool is a helper routine that returns a pointer to given integer value.
PtrFloat32 is a helper routine that returns a pointer to given float value.
PtrFloat64 is a helper routine that returns a pointer to given float value.
PtrInt is a helper routine that returns a pointer to given integer value.
PtrInt32 is a helper routine that returns a pointer to given integer value.
PtrInt64 is a helper routine that returns a pointer to given integer value.
PtrString is a helper routine that returns a pointer to given string value.
PtrTime is helper routine that returns a pointer to given Time value.

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKeys takes a string apikey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextServerIndex uses a server configuration from the index.
ContextServerVariables overrides a server configuration variables.

# Structs

Agent struct for Agent.
AgentSiteID struct for AgentSiteID.
APIClient manages communication with the runZero API API v1.0.4 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
APIResponse stores the API response returned by the server.
Asset struct for Asset.
AssetComments struct for AssetComments.
AssetsWithCheckpoint struct for AssetsWithCheckpoint.
AssetTags struct for AssetTags.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
ComponentVersion A component ID and version.
Configuration stores the configuration of the API client.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Organization struct for Organization.
OrgOptions struct for OrgOptions.
RunZeroAPIKey struct for RunZeroAPIKey.
ScanOptions struct for ScanOptions.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.
Service struct for Service.
Site struct for Site.
SiteOptions struct for SiteOptions.
Task struct for Task.
URL A URL to a resource.
Wireless struct for Wireless.

# Type aliases

ExportApiService ExportApi service.
OrganizationApiService OrganizationApi service.
PublicApiService PublicApi service.
ServerConfigurations stores multiple ServerConfiguration items.