Categorygithub.com/agaurav/sumo-openapi
repositorypackage
0.0.1
Repository: https://github.com/agaurav/sumo-openapi.git
Documentation: pkg.go.dev

# README

Go API client for openapi

Getting Started

Welcome to the Sumo Logic API reference. You can use these APIs to interact with the Sumo Logic platform. For information on the collector and search APIs see our API home page.

API Endpoints

Sumo Logic has several deployments in different geographic locations. You'll need to use the Sumo Logic API endpoint corresponding to your geographic location. See the table below for the different API endpoints by deployment. For details determining your account's deployment see API endpoints.

Deployment Endpoint
AU https://api.au.sumologic.com/api/
CA https://api.ca.sumologic.com/api/
DE https://api.de.sumologic.com/api/
EU https://api.eu.sumologic.com/api/
FED https://api.fed.sumologic.com/api/
IN https://api.in.sumologic.com/api/
JP https://api.jp.sumologic.com/api/
US1 https://api.sumologic.com/api/
US2 https://api.us2.sumologic.com/api/

Authentication

Sumo Logic supports the following options for API authentication:

  • Access ID and Access Key
  • Base64 encoded Access ID and Access Key

See Access Keys to generate an Access Key. Make sure to copy the key you create, because it is displayed only once. When you have an Access ID and Access Key you can execute requests such as the following:

curl -u \"<accessId>:<accessKey>\" -X GET https://api.<deployment>.sumologic.com/api/v1/users

Where deployment is either au, ca, de, eu, fed, in, jp, us1, or us2. See API endpoints for details.

If you prefer to use basic access authentication, you can do a Base64 encoding of your <accessId>:<accessKey> to authenticate your HTTPS request. The following is an example request, replace the placeholder <encoded> with your encoded Access ID and Access Key string:

curl -H \"Authorization: Basic <encoded>\" -X GET https://api.<deployment>.sumologic.com/api/v1/users

Refer to API Authentication for a Base64 example.

Status Codes

Generic status codes that apply to all our APIs. See the HTTP status code registry for reference.

HTTP Status Code Error Code Description
301 moved The requested resource SHOULD be accessed through returned URI in Location Header. See [troubleshooting](https://help.sumologic.com/APIs/Troubleshooting-APIs/API-301-Error-Moved) for details.
401 unauthorized Credential could not be verified.
403 forbidden This operation is not allowed for your account type or the user doesn't have the role capability to perform this action. See [troubleshooting](https://help.sumologic.com/APIs/Troubleshooting-APIs/API-403-Error-This-operation-is-not-allowed-for-your-account-type) for details.
404 notfound Requested resource could not be found.
405 method.unsupported Unsupported method for URL.
415 contenttype.invalid Invalid content type.
429 rate.limit.exceeded The API request rate is higher than 4 request per second or inflight API requests are higher than 10 request per second.
500 internal.error Internal server error.
503 service.unavailable Service is currently unavailable.

Filtering

Some API endpoints support filtering results on a specified set of fields. Each endpoint that supports filtering will list the fields that can be filtered. Multiple fields can be combined by using an ampersand & character.

For example, to get 20 users whose firstName is John and lastName is Doe:

api.sumologic.com/v1/users?limit=20&firstName=John&lastName=Doe

Sorting

Some API endpoints support sorting fields by using the sortBy query parameter. The default sort order is ascending. Prefix the field with a minus sign - to sort in descending order.

For example, to get 20 users sorted by their email in descending order:

api.sumologic.com/v1/users?limit=20&sort=-email

Asynchronous Request

Asynchronous requests do not wait for results, instead they immediately respond back with a job identifier while the job runs in the background. You can use the job identifier to track the status of the asynchronous job request. Here is a typical flow for an asynchronous request.

  1. Start an asynchronous job. On success, a job identifier is returned. The job identifier uniquely identifies your asynchronous job.

  2. Once started, use the job identifier from step 1 to track the status of your asynchronous job. An asynchronous request will typically provide an endpoint to poll for the status of asynchronous job. A successful response from the status endpoint will have the following structure:

{
    \"status\": \"Status of asynchronous request\",
    \"statusMessage\": \"Optional message with additional information in case request succeeds\",
    \"error\": \"Error object in case request fails\"
}

The status field can have one of the following values: 1. Success: The job succeeded. The statusMessage field might have additional information. 2. InProgress: The job is still running. 3. Failed: The job failed. The error field in the response will have more information about the failure.

  1. Some asynchronous APIs may provide a third endpoint (like export result) to fetch the result of an asynchronous job.

Example

Let's say we want to export a folder with the identifier 0000000006A2E86F. We will use the async export API to export all the content under the folder with id=0000000006A2E86F.

  1. Start an export job for the folder
curl -X POST -u \"<accessId>:<accessKey>\" https://api.<deployment>.sumologic.com/api/v2/content/0000000006A2E86F/export

See authentication section for more details about accessId, accessKey, and deployment. On success, you will get back a job identifier. In the response below, C03E086C137F38B4 is the job identifier.

{
    \"id\": \"C03E086C137F38B4\"
}
  1. Now poll for the status of the asynchronous job with the status endpoint.
curl -X GET -u \"<accessId>:<accessKey>\" https://api.<deployment>.sumologic.com/api/v2/content/0000000006A2E86F/export/C03E086C137F38B4/status

You may get a response like

{
    \"status\": \"InProgress\",
    \"statusMessage\": null,
    \"error\": null
}

It implies the job is still in progress. Keep polling till the status is either Success or Failed.

  1. When the asynchronous job completes (status != \"InProgress\"), you can fetch the results with the export result endpoint.
curl -X GET -u \"<accessId>:<accessKey>\" https://api.<deployment>.sumologic.com/api/v2/content/0000000006A2E86F/export/C03E086C137F38B4/result

The asynchronous job may fail (status == \"Failed\"). You can look at the error field for more details.

{
    \"status\": \"Failed\",
    \"errors\": {
        \"code\": \"content1:too_many_items\",
        \"message\": \"Too many objects: object count(1100) was greater than limit 1000\"
    }
}

Rate Limiting

  • A rate limit of four API requests per second (240 requests per minute) applies to all API calls from a user.
  • A rate limit of 10 concurrent requests to any API endpoint applies to an access key.

If a rate is exceeded, a rate limit exceeded 429 status code is returned.

Generating Clients

You can use OpenAPI Generator to generate clients from the YAML file to access the API.

Using NPM

  1. Install NPM package wrapper globally, exposing the CLI on the command line:
npm install @openapitools/openapi-generator-cli -g

You can see detailed instructions here.

  1. Download the YAML file and save it locally. Let's say the file is saved as sumologic-api.yaml.
  2. Use the following command to generate python client inside the sumo/client/python directory:
openapi-generator generate -i sumologic-api.yaml -g python -o sumo/client/python

Using Homebrew

  1. Install OpenAPI Generator
brew install openapi-generator
  1. Download the YAML file and save it locally. Let's say the file is saved as sumologic-api.yaml.
  2. Use the following command to generate python client side code inside the sumo/client/python directory:
openapi-generator generate -i sumologic-api.yaml -g python -o sumo/client/python

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.0
  • Package version: 1.0.0
  • 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 "./openapi"

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 https://api.au.sumologic.com/api

ClassMethodHTTP requestDescription
AccessKeyManagementApiCreateAccessKeyPost /v1/accessKeysCreate an access key.
AccessKeyManagementApiDeleteAccessKeyDelete /v1/accessKeys/{id}Delete an access key.
AccessKeyManagementApiListAccessKeysGet /v1/accessKeysList all access keys.
AccessKeyManagementApiListPersonalAccessKeysGet /v1/accessKeys/personalList personal keys.
AccessKeyManagementApiUpdateAccessKeyPut /v1/accessKeys/{id}Update an access key.
AccountManagementApiCreateSubdomainPost /v1/account/subdomainCreate account subdomain.
AccountManagementApiDeleteSubdomainDelete /v1/account/subdomainDelete the configured subdomain.
AccountManagementApiGetAccountOwnerGet /v1/account/accountOwnerGet the owner of an account.
AccountManagementApiGetStatusGet /v1/account/statusGet overview of the account status.
AccountManagementApiGetSubdomainGet /v1/account/subdomainGet the configured subdomain.
AccountManagementApiRecoverSubdomainsPost /v1/account/subdomain/recoverRecover subdomains for a user.
AccountManagementApiUpdateSubdomainPut /v1/account/subdomainUpdate account subdomain.
AppManagementApiGetAppGet /v1/apps/{uuid}Get an app by UUID.
AppManagementApiGetAsyncInstallStatusGet /v1/apps/install/{jobId}/statusApp install job status.
AppManagementApiInstallAppPost /v1/apps/{uuid}/installInstall an app by UUID.
AppManagementApiListAppsGet /v1/appsList available apps.
ArchiveManagementApiCreateArchiveJobPost /v1/archive/{sourceId}/jobsCreate an ingestion job.
ArchiveManagementApiDeleteArchiveJobDelete /v1/archive/{sourceId}/jobs/{id}Delete an ingestion job.
ArchiveManagementApiListArchiveJobsBySourceIdGet /v1/archive/{sourceId}/jobsGet ingestion jobs for an Archive Source.
ArchiveManagementApiListArchiveJobsCountPerSourceGet /v1/archive/jobs/countList ingestion jobs for all Archive Sources.
ConnectionManagementApiCreateConnectionPost /v1/connectionsCreate a new connection.
ConnectionManagementApiDeleteConnectionDelete /v1/connections/{id}Delete a connection.
ConnectionManagementApiGetConnectionGet /v1/connections/{id}Get a connection.
ConnectionManagementApiListConnectionsGet /v1/connectionsGet a list of connections.
ConnectionManagementApiTestConnectionPost /v1/connections/testTest a new connection url.
ConnectionManagementApiUpdateConnectionPut /v1/connections/{id}Update a connection.
ContentManagementApiAsyncCopyStatusGet /v2/content/{id}/copy/{jobId}/statusContent copy job status.
ContentManagementApiBeginAsyncCopyPost /v2/content/{id}/copyStart a content copy job.
ContentManagementApiBeginAsyncDeleteDelete /v2/content/{id}/deleteStart a content deletion job.
ContentManagementApiBeginAsyncExportPost /v2/content/{id}/exportStart a content export job.
ContentManagementApiBeginAsyncImportPost /v2/content/folders/{folderId}/importStart a content import job.
ContentManagementApiGetAsyncDeleteStatusGet /v2/content/{id}/delete/{jobId}/statusContent deletion job status.
ContentManagementApiGetAsyncExportResultGet /v2/content/{contentId}/export/{jobId}/resultContent export job result.
ContentManagementApiGetAsyncExportStatusGet /v2/content/{contentId}/export/{jobId}/statusContent export job status.
ContentManagementApiGetAsyncImportStatusGet /v2/content/folders/{folderId}/import/{jobId}/statusContent import job status.
ContentManagementApiGetItemByPathGet /v2/content/pathGet content item by path.
ContentManagementApiGetPathByIdGet /v2/content/{contentId}/pathGet path of an item.
ContentManagementApiMoveItemPost /v2/content/{id}/moveMove an item.
ContentPermissionsApiAddContentPermissionsPut /v2/content/{id}/permissions/addAdd permissions to a content item.
ContentPermissionsApiGetContentPermissionsGet /v2/content/{id}/permissionsGet permissions of a content item
ContentPermissionsApiRemoveContentPermissionsPut /v2/content/{id}/permissions/removeRemove permissions from a content item.
DashboardManagementApiCreateDashboardPost /v2/dashboardsCreate a new dashboard.
DashboardManagementApiDeleteDashboardDelete /v2/dashboards/{id}Delete a dashboard.
DashboardManagementApiGetDashboardGet /v2/dashboards/{id}Get a dashboard.
DashboardManagementApiUpdateDashboardPut /v2/dashboards/{id}Update a dashboard.
DynamicParsingRuleManagementApiCreateDynamicParsingRulePost /v1/dynamicParsingRulesCreate a new dynamic parsing rule.
DynamicParsingRuleManagementApiDeleteDynamicParsingRuleDelete /v1/dynamicParsingRules/{id}Delete a dynamic parsing rule.
DynamicParsingRuleManagementApiGetDynamicParsingRuleGet /v1/dynamicParsingRules/{id}Get a dynamic parsing rule.
DynamicParsingRuleManagementApiListDynamicParsingRulesGet /v1/dynamicParsingRulesGet a list of dynamic parsing rules.
DynamicParsingRuleManagementApiUpdateDynamicParsingRulePut /v1/dynamicParsingRules/{id}Update a dynamic parsing rule.
ExtractionRuleManagementApiCreateExtractionRulePost /v1/extractionRulesCreate a new field extraction rule.
ExtractionRuleManagementApiDeleteExtractionRuleDelete /v1/extractionRules/{id}Delete a field extraction rule.
ExtractionRuleManagementApiGetExtractionRuleGet /v1/extractionRules/{id}Get a field extraction rule.
ExtractionRuleManagementApiListExtractionRulesGet /v1/extractionRulesGet a list of field extraction rules.
ExtractionRuleManagementApiUpdateExtractionRulePut /v1/extractionRules/{id}Update a field extraction rule.
FieldManagementV1ApiCreateFieldPost /v1/fieldsCreate a new field.
FieldManagementV1ApiDeleteFieldDelete /v1/fields/{id}Delete a custom field.
FieldManagementV1ApiDisableFieldDelete /v1/fields/{id}/disableDisable a custom field.
FieldManagementV1ApiEnableFieldPut /v1/fields/{id}/enableEnable custom field with a specified identifier.
FieldManagementV1ApiGetBuiltInFieldGet /v1/fields/builtin/{id}Get a built-in field.
FieldManagementV1ApiGetCustomFieldGet /v1/fields/{id}Get a custom field.
FieldManagementV1ApiGetFieldQuotaGet /v1/fields/quotaGet capacity information.
FieldManagementV1ApiListBuiltInFieldsGet /v1/fields/builtinGet a list of built-in fields.
FieldManagementV1ApiListCustomFieldsGet /v1/fieldsGet a list of all custom fields.
FieldManagementV1ApiListDroppedFieldsGet /v1/fields/droppedGet a list of dropped fields.
FolderManagementApiCreateFolderPost /v2/content/foldersCreate a new folder.
FolderManagementApiGetAdminRecommendedFolderAsyncGet /v2/content/folders/adminRecommendedSchedule Admin Recommended folder job
FolderManagementApiGetAdminRecommendedFolderAsyncResultGet /v2/content/folders/adminRecommended/{jobId}/resultGet Admin Recommended folder job result
FolderManagementApiGetAdminRecommendedFolderAsyncStatusGet /v2/content/folders/adminRecommended/{jobId}/statusGet Admin Recommended folder job status
FolderManagementApiGetFolderGet /v2/content/folders/{id}Get a folder.
FolderManagementApiGetGlobalFolderAsyncGet /v2/content/folders/globalSchedule Global View job
FolderManagementApiGetGlobalFolderAsyncResultGet /v2/content/folders/global/{jobId}/resultGet Global View job result
FolderManagementApiGetGlobalFolderAsyncStatusGet /v2/content/folders/global/{jobId}/statusGet Global View job status
FolderManagementApiGetPersonalFolderGet /v2/content/folders/personalGet personal folder.
FolderManagementApiUpdateFolderPut /v2/content/folders/{id}Update a folder.
HealthEventsApiListAllHealthEventsGet /v1/healthEventsGet a list of health events.
HealthEventsApiListAllHealthEventsForResourcesPost /v1/healthEvents/resourcesHealth events for specific resources.
IngestBudgetManagementV1ApiAssignCollectorToBudgetPut /v1/ingestBudgets/{id}/collectors/{collectorId}Assign a Collector to a budget.
IngestBudgetManagementV1ApiCreateIngestBudgetPost /v1/ingestBudgetsCreate a new ingest budget.
IngestBudgetManagementV1ApiDeleteIngestBudgetDelete /v1/ingestBudgets/{id}Delete an ingest budget.
IngestBudgetManagementV1ApiGetAssignedCollectorsGet /v1/ingestBudgets/{id}/collectorsGet a list of Collectors.
IngestBudgetManagementV1ApiGetIngestBudgetGet /v1/ingestBudgets/{id}Get an ingest budget.
IngestBudgetManagementV1ApiListIngestBudgetsGet /v1/ingestBudgetsGet a list of ingest budgets.
IngestBudgetManagementV1ApiRemoveCollectorFromBudgetDelete /v1/ingestBudgets/{id}/collectors/{collectorId}Remove Collector from a budget.
IngestBudgetManagementV1ApiResetUsagePost /v1/ingestBudgets/{id}/usage/resetReset usage.
IngestBudgetManagementV1ApiUpdateIngestBudgetPut /v1/ingestBudgets/{id}Update an ingest budget.
IngestBudgetManagementV2ApiCreateIngestBudgetV2Post /v2/ingestBudgetsCreate a new ingest budget.
IngestBudgetManagementV2ApiDeleteIngestBudgetV2Delete /v2/ingestBudgets/{id}Delete an ingest budget.
IngestBudgetManagementV2ApiGetIngestBudgetV2Get /v2/ingestBudgets/{id}Get an ingest budget.
IngestBudgetManagementV2ApiListIngestBudgetsV2Get /v2/ingestBudgetsGet a list of ingest budgets.
IngestBudgetManagementV2ApiResetUsageV2Post /v2/ingestBudgets/{id}/usage/resetReset usage.
IngestBudgetManagementV2ApiUpdateIngestBudgetV2Put /v2/ingestBudgets/{id}Update an ingest budget.
LogSearchesEstimatedUsageApiGetLogSearchEstimatedUsagePost /v1/logSearches/estimatedUsageGets estimated usage details.
LogSearchesEstimatedUsageApiGetLogSearchEstimatedUsageByTierPost /v1/logSearches/estimatedUsageByTierGets Tier Wise estimated usage details.
LookupManagementApiCreateTablePost /v1/lookupTablesCreate a lookup table.
LookupManagementApiDeleteTableDelete /v1/lookupTables/{id}Delete a lookup table.
LookupManagementApiDeleteTableRowPut /v1/lookupTables/{id}/deleteTableRowDelete a lookup table row.
LookupManagementApiLookupTableByIdGet /v1/lookupTables/{id}Get a lookup table.
LookupManagementApiRequestJobStatusGet /v1/lookupTables/jobs/{jobId}/statusGet the status of an async job.
LookupManagementApiTruncateTablePost /v1/lookupTables/{id}/truncateEmpty a lookup table.
LookupManagementApiUpdateTablePut /v1/lookupTables/{id}Edit a lookup table.
LookupManagementApiUpdateTableRowPut /v1/lookupTables/{id}/rowInsert or Update a lookup table row.
LookupManagementApiUploadFilePost /v1/lookupTables/{id}/uploadUpload a CSV file.
MetricsQueryApiRunMetricsQueriesPost /v1/metricsQueriesRun metrics queries
MetricsSearchesManagementApiCreateMetricsSearchPost /v1/metricsSearchesSave a metrics search.
MetricsSearchesManagementApiDeleteMetricsSearchDelete /v1/metricsSearches/{id}Deletes a metrics search.
MetricsSearchesManagementApiGetMetricsSearchGet /v1/metricsSearches/{id}Get a metrics search.
MetricsSearchesManagementApiUpdateMetricsSearchPut /v1/metricsSearches/{id}Updates a metrics search.
MonitorsLibraryManagementApiDisableMonitorByIdsPut /v1/monitors/disableDisable monitors.
MonitorsLibraryManagementApiGetMonitorUsageInfoGet /v1/monitors/usageInfoUsage info of monitors.
MonitorsLibraryManagementApiGetMonitorsFullPathGet /v1/monitors/{id}/pathGet the path of a monitor or folder.
MonitorsLibraryManagementApiGetMonitorsLibraryRootGet /v1/monitors/rootGet the root monitors folder.
MonitorsLibraryManagementApiMonitorsCopyPost /v1/monitors/{id}/copyCopy a monitor or folder.
MonitorsLibraryManagementApiMonitorsCreatePost /v1/monitorsCreate a monitor or folder.
MonitorsLibraryManagementApiMonitorsDeleteByIdDelete /v1/monitors/{id}Delete a monitor or folder.
MonitorsLibraryManagementApiMonitorsDeleteByIdsDelete /v1/monitorsBulk delete a monitor or folder.
MonitorsLibraryManagementApiMonitorsExportItemGet /v1/monitors/{id}/exportExport a monitor or folder.
MonitorsLibraryManagementApiMonitorsGetByPathGet /v1/monitors/pathRead a monitor or folder by its path.
MonitorsLibraryManagementApiMonitorsImportItemPost /v1/monitors/{parentId}/importImport a monitor or folder.
MonitorsLibraryManagementApiMonitorsMovePost /v1/monitors/{id}/moveMove a monitor or folder.
MonitorsLibraryManagementApiMonitorsReadByIdGet /v1/monitors/{id}Get a monitor or folder.
MonitorsLibraryManagementApiMonitorsReadByIdsGet /v1/monitorsBulk read a monitor or folder.
MonitorsLibraryManagementApiMonitorsSearchGet /v1/monitors/searchSearch for a monitor or folder.
MonitorsLibraryManagementApiMonitorsUpdateByIdPut /v1/monitors/{id}Update a monitor or folder.
PartitionManagementApiCancelRetentionUpdatePost /v1/partitions/{id}/cancelRetentionUpdateCancel a retention update for a partition
PartitionManagementApiCreatePartitionPost /v1/partitionsCreate a new partition.
PartitionManagementApiDecommissionPartitionPost /v1/partitions/{id}/decommissionDecommission a partition.
PartitionManagementApiGetPartitionGet /v1/partitions/{id}Get a partition.
PartitionManagementApiListPartitionsGet /v1/partitionsGet a list of partitions.
PartitionManagementApiUpdatePartitionPut /v1/partitions/{id}Update a partition.
PasswordPolicyApiGetPasswordPolicyGet /v1/passwordPolicyGet the current password policy.
PasswordPolicyApiSetPasswordPolicyPut /v1/passwordPolicyUpdate password policy.
PoliciesManagementApiGetAuditPolicyGet /v1/policies/auditGet Audit policy.
PoliciesManagementApiGetDataAccessLevelPolicyGet /v1/policies/dataAccessLevelGet Data Access Level policy.
PoliciesManagementApiGetMaxUserSessionTimeoutPolicyGet /v1/policies/maxUserSessionTimeoutGet Max User Session Timeout policy.
PoliciesManagementApiGetSearchAuditPolicyGet /v1/policies/searchAuditGet Search Audit policy.
PoliciesManagementApiGetShareDashboardsOutsideOrganizationPolicyGet /v1/policies/shareDashboardsOutsideOrganizationGet Share Dashboards Outside Organization policy.
PoliciesManagementApiGetUserConcurrentSessionsLimitPolicyGet /v1/policies/userConcurrentSessionsLimitGet User Concurrent Sessions Limit policy.
PoliciesManagementApiSetAuditPolicyPut /v1/policies/auditSet Audit policy.
PoliciesManagementApiSetDataAccessLevelPolicyPut /v1/policies/dataAccessLevelSet Data Access Level policy.
PoliciesManagementApiSetMaxUserSessionTimeoutPolicyPut /v1/policies/maxUserSessionTimeoutSet Max User Session Timeout policy.
PoliciesManagementApiSetSearchAuditPolicyPut /v1/policies/searchAuditSet Search Audit policy.
PoliciesManagementApiSetShareDashboardsOutsideOrganizationPolicyPut /v1/policies/shareDashboardsOutsideOrganizationSet Share Dashboards Outside Organization policy.
PoliciesManagementApiSetUserConcurrentSessionsLimitPolicyPut /v1/policies/userConcurrentSessionsLimitSet User Concurrent Sessions Limit policy.
RoleManagementApiAssignRoleToUserPut /v1/roles/{roleId}/users/{userId}Assign a role to a user.
RoleManagementApiCreateRolePost /v1/rolesCreate a new role.
RoleManagementApiDeleteRoleDelete /v1/roles/{id}Delete a role.
RoleManagementApiGetRoleGet /v1/roles/{id}Get a role.
RoleManagementApiListRolesGet /v1/rolesGet a list of roles.
RoleManagementApiRemoveRoleFromUserDelete /v1/roles/{roleId}/users/{userId}Remove role from a user.
RoleManagementApiUpdateRolePut /v1/roles/{id}Update a role.
SamlConfigurationManagementApiCreateAllowlistedUserPost /v1/saml/allowlistedUsers/{userId}Allowlist a user.
SamlConfigurationManagementApiCreateIdentityProviderPost /v1/saml/identityProvidersCreate a new SAML configuration.
SamlConfigurationManagementApiDeleteAllowlistedUserDelete /v1/saml/allowlistedUsers/{userId}Remove an allowlisted user.
SamlConfigurationManagementApiDeleteIdentityProviderDelete /v1/saml/identityProviders/{id}Delete a SAML configuration.
SamlConfigurationManagementApiDisableSamlLockdownPost /v1/saml/lockdown/disableDisable SAML lockdown.
SamlConfigurationManagementApiEnableSamlLockdownPost /v1/saml/lockdown/enableRequire SAML for sign-in.
SamlConfigurationManagementApiGetAllowlistedUsersGet /v1/saml/allowlistedUsersGet list of allowlisted users.
SamlConfigurationManagementApiGetIdentityProvidersGet /v1/saml/identityProvidersGet a list of SAML configurations.
SamlConfigurationManagementApiUpdateIdentityProviderPut /v1/saml/identityProviders/{id}Update a SAML configuration.
ScheduledViewManagementApiCreateScheduledViewPost /v1/scheduledViewsCreate a new scheduled view.
ScheduledViewManagementApiDisableScheduledViewDelete /v1/scheduledViews/{id}/disableDisable a scheduled view.
ScheduledViewManagementApiGetScheduledViewGet /v1/scheduledViews/{id}Get a scheduled view.
ScheduledViewManagementApiListScheduledViewsGet /v1/scheduledViewsGet a list of scheduled views.
ScheduledViewManagementApiPauseScheduledViewPost /v1/scheduledViews/{id}/pausePause a scheduled view.
ScheduledViewManagementApiStartScheduledViewPost /v1/scheduledViews/{id}/startStart a scheduled view.
ScheduledViewManagementApiUpdateScheduledViewPut /v1/scheduledViews/{id}Update a scheduled view.
ServiceAllowlistManagementApiAddAllowlistedCidrsPost /v1/serviceAllowlist/addresses/addAllowlist CIDRs/IP addresses.
ServiceAllowlistManagementApiDeleteAllowlistedCidrsPost /v1/serviceAllowlist/addresses/removeRemove allowlisted CIDRs/IP addresses.
ServiceAllowlistManagementApiDisableAllowlistingPost /v1/serviceAllowlist/disableDisable service allowlisting.
ServiceAllowlistManagementApiEnableAllowlistingPost /v1/serviceAllowlist/enableEnable service allowlisting.
ServiceAllowlistManagementApiGetAllowlistingStatusGet /v1/serviceAllowlist/statusGet the allowlisting status.
ServiceAllowlistManagementApiListAllowlistedCidrsGet /v1/serviceAllowlist/addressesList all allowlisted CIDRs/IP addresses.
TokensLibraryManagementApiCreateTokenPost /v1/tokensCreate a token.
TokensLibraryManagementApiDeleteTokenDelete /v1/tokens/{id}Delete a token.
TokensLibraryManagementApiGetTokenGet /v1/tokens/{id}Get a token.
TokensLibraryManagementApiListTokensGet /v1/tokensGet a list of tokens.
TokensLibraryManagementApiUpdateTokenPut /v1/tokens/{id}Update a token.
TransformationRuleManagementApiCreateRulePost /v1/transformationRulesCreate a new transformation rule.
TransformationRuleManagementApiDeleteRuleDelete /v1/transformationRules/{id}Delete a transformation rule.
TransformationRuleManagementApiGetTransformationRuleGet /v1/transformationRules/{id}Get a transformation rule.
TransformationRuleManagementApiGetTransformationRulesGet /v1/transformationRulesGet a list of transformation rules.
TransformationRuleManagementApiUpdateTransformationRulePut /v1/transformationRules/{id}Update a transformation rule.
UserManagementApiCreateUserPost /v1/usersCreate a new user.
UserManagementApiDeleteUserDelete /v1/users/{id}Delete a user.
UserManagementApiDisableMfaPut /v1/users/{id}/mfa/disableDisable MFA for user.
UserManagementApiGetUserGet /v1/users/{id}Get a user.
UserManagementApiListUsersGet /v1/usersGet a list of users.
UserManagementApiRequestChangeEmailPost /v1/users/{id}/email/requestChangeChange email address.
UserManagementApiResetPasswordPost /v1/users/{id}/password/resetReset password.
UserManagementApiUnlockUserPost /v1/users/{id}/unlockUnlock a user.
UserManagementApiUpdateUserPut /v1/users/{id}Update a user.

Documentation For Models

Documentation For Authorization

basicAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

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