package
4.3.0+incompatible
Repository: https://github.com/nextlinux/enterprise-client-go.git
Documentation: pkg.go.dev

# README

Go API client for enterprise

This is the Nextlinux Enterprise API. It provides additional external API routes and functionality for enterprise users.

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: 0.7.0
  • Package version: 4.6.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 "./enterprise"

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/enterprise

ClassMethodHTTP requestDescription
ActionsApiAddActionPlanPost /actionsSubmits an Action Plan
ActionsApiGetActionPlansGet /actionsGets a list of submitted action (remediation) plans
AlertsApiGetAlertSummariesGet /alerts/summariesList all alert summaries scoped to the account
AlertsApiGetComplianceViolationAlertGet /alerts/compliance_violations/{uuid}Get compliance violation alert by id
AlertsApiGetComplianceViolationAlertsGet /alerts/compliance_violationsList all compliance violation alerts scoped to the account
AlertsApiUpdateComplianceViolationAlertStatePut /alerts/compliance_violations/{uuid}/{state}Open or close a compliance violation alert
ApplicationsApiAddApplicationPost /applicationsCreate an application
ApplicationsApiAddApplicationVersionPost /applications/{application_id}/versionsCreate an application version
ApplicationsApiAddArtifactToApplicationVersionPost /applications/{application_id}/versions/{application_version_id}/artifactsAdd an artifact to an application version
ApplicationsApiDeleteApplicationDelete /applications/{application_id}Delete an application by application_id
ApplicationsApiDeleteApplicationVersionDelete /applications/{application_id}/versions/{application_version_id}Delete an application version by application_id and application_version_id
ApplicationsApiGetApplicationGet /applications/{application_id}Get an application by application_id
ApplicationsApiGetApplicationVersionGet /applications/{application_id}/versions/{application_version_id}Get an application version
ApplicationsApiGetApplicationVersionSbomGet /applications/{application_id}/versions/{application_version_id}/sboms/jsonGet the combined sbom for the given application version, optionally filtered by artifact type
ApplicationsApiGetApplicationVersionVulnerabilitiesGet /applications/{application_id}/versions/{application_version_id}/vulnerabilitiesGet the vulnerabilities for a given application version
ApplicationsApiGetApplicationVersionsGet /applications/{application_id}/versionsList all application verions
ApplicationsApiGetApplicationsGet /applicationsList all applications
ApplicationsApiListArtifactsGet /applications/{application_id}/versions/{application_version_id}/artifactsList artifacts present on a given application version
ApplicationsApiRemoveArtifactFromApplicationVersionDelete /applications/{application_id}/versions/{application_version_id}/artifacts/{association_id}Delete an artifact from specified application version
ApplicationsApiUpdateApplicationPut /applications/{application_id}Update application details
ApplicationsApiUpdateApplicationVersionPut /applications/{application_id}/versions/{application_version_id}Update application version details
ComplianceApiAddRuntimeComplianceCheckPost /runtime_compliancePost a runtime compliance check
ComplianceApiGetRuntimeComplianceChecksGet /runtime_complianceGet all runtime compliance checks or just those for a given image digest
ComplianceApiGetRuntimeComplianceResultGet /runtime_compliance/result/{compliance_file_id}Check the results of a a specific runtime compliance check
CorrectionsApiAddCorrectionPost /correctionsCreate a correction record
CorrectionsApiDeleteCorrectionByUuidDelete /corrections/{uuid}Delete a correction by UUID
CorrectionsApiGetCorrectionByUuidGet /corrections/{uuid}Retrieve a correction by UUID
CorrectionsApiGetCorrectionsGet /correctionsRetrieve a list of corrections
CorrectionsApiUpdateCorrectionByUuidPut /corrections/{uuid}Update a correction by UUID
DefaultApiGetKubernetesNamespacesGet /kubernetes-namespacesReturn a list of Kubernetes namespaces that have been inventoried for this account
ImagesApiGetImageAncestorsGet /images/{image_digest}/ancestorsReturn the list of ancestor images for the given image
ImagesApiGetImagePolicyCheckByDigestGet /images/{imageDigest}/checkCheck policy evaluation status for image
ImagesApiGetImageVulnerabilitiesByDigestGet /images/{imageDigest}/vuln/{vtype}Get vulnerabilities by type
ImportsApiCreateOperationPost /imports/sourcesBegin the import of a source code repository analyzed by Syft into the system
ImportsApiFinalizeOperationPost /imports/sources/{operation_id}/finalizeAdd source records to catalog db
ImportsApiGetImportSourcesSbomGet /imports/sources/{operation_id}/sbomlist the packages of an imported source code repository
ImportsApiGetOperationGet /imports/sources/{operation_id}Get detail on a single import
ImportsApiInvalidateOperationDelete /imports/sources/{operation_id}Invalidate operation ID so it can be garbage collected
ImportsApiListOperationsGet /imports/sourcesLists in-progress imports
ImportsApiUploadImportSourcesSbomPost /imports/sources/{operation_id}/sbomBegin the import of a source code repository analyzed by Syft into the system
InventoriesApiDeleteInventoryDelete /inventoriesDelete runtime inventory by type and context
InventoriesApiGetImageInventoryGet /inventoriesReturn a list of the images in inventories for this account
InventoriesApiPostEcsInventoryPost /ecs-inventoryAdd container metadata from Amazon ECS
InventoriesApiPostKubernetesInventoryPost /kubernetes-inventoryAdd container metadata from a Kubernetes deployment
InventoriesApiSyncImageInventoryPost /inventoriessynchronizes the list of the images in a given cluster for the inventory
RelationshipsApiAddArtifactRelationshipPost /artifact_relationships
RelationshipsApiDeleteArtifactRelationshipsDelete /artifact_relationships
RelationshipsApiGetArtifactRelationshipGet /artifact_relationships/{relationship_id}
RelationshipsApiGetRelationshipSbomDiffGet /artifact_relationships/{relationship_id}/diffs/sbom
RelationshipsApiListArtifactRelationshipsGet /artifact_relationships
SourcesApiDeleteSourceDelete /sources/{source_id}Delete source record from DB
SourcesApiGetSourceGet /sources/{source_id}Get a detailed source repository analysis metadata record
SourcesApiGetSourceContentByTypeGet /sources/{source_id}/content/{content_type}Get the content of an analyzed source repository
SourcesApiGetSourceContentTypesGet /sources/{source_id}/contentGet a detailed source repository analysis metadata record
SourcesApiGetSourcePolicyCheckGet /sources/{source_id}/checkFetch or calculate policy evaluation for a source
SourcesApiGetSourceSbomCyclonedxJsonGet /sources/{source_id}/sbom/cyclonedx-jsonReturn the source SBOM in the CycloneDX format
SourcesApiGetSourceSbomNativeGet /sources/{source_id}/sbom/nativeReturn the compressed source SBOM in the native Nextlinux format
SourcesApiGetSourceSbomNativeJsonGet /sources/{source_id}/sbom/native-jsonReturn the source SBOM in the native Nextlinux format
SourcesApiGetSourceSbomSpdxJsonGet /sources/{source_id}/sbom/spdx-jsonReturn the source SBOM in the SPDX format
SourcesApiGetSourceSbomTypesGet /sources/{source_id}/sbomGet a detailed source repository analysis metadata record
SourcesApiGetSourceVulnerabilitiesGet /sources/{source_id}/vuln/{vtype}Get vulnerabilities for the source by type
SourcesApiGetSourceVulnerabilityTypesGet /sources/{source_id}/vulnGet the available vulnerability types for source
SourcesApiListSourcesGet /sourcesList the source repository analysis records
StatelessApiGetStatelessSbomVulnerabilitiesPost /stateless/sbom/vuln/{vtype}Get vulnerabilities for input sbom by type

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

[email protected]