# 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
Class | Method | HTTP request | Description |
---|---|---|---|
ActionsApi | AddActionPlan | Post /actions | Submits an Action Plan |
ActionsApi | GetActionPlans | Get /actions | Gets a list of submitted action (remediation) plans |
AlertsApi | GetAlertSummaries | Get /alerts/summaries | List all alert summaries scoped to the account |
AlertsApi | GetComplianceViolationAlert | Get /alerts/compliance_violations/{uuid} | Get compliance violation alert by id |
AlertsApi | GetComplianceViolationAlerts | Get /alerts/compliance_violations | List all compliance violation alerts scoped to the account |
AlertsApi | UpdateComplianceViolationAlertState | Put /alerts/compliance_violations/{uuid}/{state} | Open or close a compliance violation alert |
ApplicationsApi | AddApplication | Post /applications | Create an application |
ApplicationsApi | AddApplicationVersion | Post /applications/{application_id}/versions | Create an application version |
ApplicationsApi | AddArtifactToApplicationVersion | Post /applications/{application_id}/versions/{application_version_id}/artifacts | Add an artifact to an application version |
ApplicationsApi | DeleteApplication | Delete /applications/{application_id} | Delete an application by application_id |
ApplicationsApi | DeleteApplicationVersion | Delete /applications/{application_id}/versions/{application_version_id} | Delete an application version by application_id and application_version_id |
ApplicationsApi | GetApplication | Get /applications/{application_id} | Get an application by application_id |
ApplicationsApi | GetApplicationVersion | Get /applications/{application_id}/versions/{application_version_id} | Get an application version |
ApplicationsApi | GetApplicationVersionSbom | Get /applications/{application_id}/versions/{application_version_id}/sboms/json | Get the combined sbom for the given application version, optionally filtered by artifact type |
ApplicationsApi | GetApplicationVersionVulnerabilities | Get /applications/{application_id}/versions/{application_version_id}/vulnerabilities | Get the vulnerabilities for a given application version |
ApplicationsApi | GetApplicationVersions | Get /applications/{application_id}/versions | List all application verions |
ApplicationsApi | GetApplications | Get /applications | List all applications |
ApplicationsApi | ListArtifacts | Get /applications/{application_id}/versions/{application_version_id}/artifacts | List artifacts present on a given application version |
ApplicationsApi | RemoveArtifactFromApplicationVersion | Delete /applications/{application_id}/versions/{application_version_id}/artifacts/{association_id} | Delete an artifact from specified application version |
ApplicationsApi | UpdateApplication | Put /applications/{application_id} | Update application details |
ApplicationsApi | UpdateApplicationVersion | Put /applications/{application_id}/versions/{application_version_id} | Update application version details |
ComplianceApi | AddRuntimeComplianceCheck | Post /runtime_compliance | Post a runtime compliance check |
ComplianceApi | GetRuntimeComplianceChecks | Get /runtime_compliance | Get all runtime compliance checks or just those for a given image digest |
ComplianceApi | GetRuntimeComplianceResult | Get /runtime_compliance/result/{compliance_file_id} | Check the results of a a specific runtime compliance check |
CorrectionsApi | AddCorrection | Post /corrections | Create a correction record |
CorrectionsApi | DeleteCorrectionByUuid | Delete /corrections/{uuid} | Delete a correction by UUID |
CorrectionsApi | GetCorrectionByUuid | Get /corrections/{uuid} | Retrieve a correction by UUID |
CorrectionsApi | GetCorrections | Get /corrections | Retrieve a list of corrections |
CorrectionsApi | UpdateCorrectionByUuid | Put /corrections/{uuid} | Update a correction by UUID |
DefaultApi | GetKubernetesNamespaces | Get /kubernetes-namespaces | Return a list of Kubernetes namespaces that have been inventoried for this account |
ImagesApi | GetImageAncestors | Get /images/{image_digest}/ancestors | Return the list of ancestor images for the given image |
ImagesApi | GetImagePolicyCheckByDigest | Get /images/{imageDigest}/check | Check policy evaluation status for image |
ImagesApi | GetImageVulnerabilitiesByDigest | Get /images/{imageDigest}/vuln/{vtype} | Get vulnerabilities by type |
ImportsApi | CreateOperation | Post /imports/sources | Begin the import of a source code repository analyzed by Syft into the system |
ImportsApi | FinalizeOperation | Post /imports/sources/{operation_id}/finalize | Add source records to catalog db |
ImportsApi | GetImportSourcesSbom | Get /imports/sources/{operation_id}/sbom | list the packages of an imported source code repository |
ImportsApi | GetOperation | Get /imports/sources/{operation_id} | Get detail on a single import |
ImportsApi | InvalidateOperation | Delete /imports/sources/{operation_id} | Invalidate operation ID so it can be garbage collected |
ImportsApi | ListOperations | Get /imports/sources | Lists in-progress imports |
ImportsApi | UploadImportSourcesSbom | Post /imports/sources/{operation_id}/sbom | Begin the import of a source code repository analyzed by Syft into the system |
InventoriesApi | DeleteInventory | Delete /inventories | Delete runtime inventory by type and context |
InventoriesApi | GetImageInventory | Get /inventories | Return a list of the images in inventories for this account |
InventoriesApi | PostEcsInventory | Post /ecs-inventory | Add container metadata from Amazon ECS |
InventoriesApi | PostKubernetesInventory | Post /kubernetes-inventory | Add container metadata from a Kubernetes deployment |
InventoriesApi | SyncImageInventory | Post /inventories | synchronizes the list of the images in a given cluster for the inventory |
RelationshipsApi | AddArtifactRelationship | Post /artifact_relationships | |
RelationshipsApi | DeleteArtifactRelationships | Delete /artifact_relationships | |
RelationshipsApi | GetArtifactRelationship | Get /artifact_relationships/{relationship_id} | |
RelationshipsApi | GetRelationshipSbomDiff | Get /artifact_relationships/{relationship_id}/diffs/sbom | |
RelationshipsApi | ListArtifactRelationships | Get /artifact_relationships | |
SourcesApi | DeleteSource | Delete /sources/{source_id} | Delete source record from DB |
SourcesApi | GetSource | Get /sources/{source_id} | Get a detailed source repository analysis metadata record |
SourcesApi | GetSourceContentByType | Get /sources/{source_id}/content/{content_type} | Get the content of an analyzed source repository |
SourcesApi | GetSourceContentTypes | Get /sources/{source_id}/content | Get a detailed source repository analysis metadata record |
SourcesApi | GetSourcePolicyCheck | Get /sources/{source_id}/check | Fetch or calculate policy evaluation for a source |
SourcesApi | GetSourceSbomCyclonedxJson | Get /sources/{source_id}/sbom/cyclonedx-json | Return the source SBOM in the CycloneDX format |
SourcesApi | GetSourceSbomNative | Get /sources/{source_id}/sbom/native | Return the compressed source SBOM in the native Nextlinux format |
SourcesApi | GetSourceSbomNativeJson | Get /sources/{source_id}/sbom/native-json | Return the source SBOM in the native Nextlinux format |
SourcesApi | GetSourceSbomSpdxJson | Get /sources/{source_id}/sbom/spdx-json | Return the source SBOM in the SPDX format |
SourcesApi | GetSourceSbomTypes | Get /sources/{source_id}/sbom | Get a detailed source repository analysis metadata record |
SourcesApi | GetSourceVulnerabilities | Get /sources/{source_id}/vuln/{vtype} | Get vulnerabilities for the source by type |
SourcesApi | GetSourceVulnerabilityTypes | Get /sources/{source_id}/vuln | Get the available vulnerability types for source |
SourcesApi | ListSources | Get /sources | List the source repository analysis records |
StatelessApi | GetStatelessSbomVulnerabilities | Post /stateless/sbom/vuln/{vtype} | Get vulnerabilities for input sbom by type |
Documentation For Models
- ActionPlan
- ActionPlanResolution
- AlertSummary
- ApiErrorResponse
- Application
- ApplicationVersion
- ApplicationVersionSbom
- ApplicationVersionVulnerabilityReport
- ApplicationVersionVulnerabilityReportApplication
- ApplicationVersionVulnerabilityReportApplicationArtifacts
- ArtifactAssociationMetadata
- ArtifactAssociationRequest
- ArtifactAssociationResponse
- ArtifactListResponse
- ArtifactReference
- ArtifactRelationship
- ArtifactType
- AssociatedImageArtifact
- AssociatedSourceArtifact
- CVSSV2Scores
- CVSSV3Scores
- ComplianceResource
- ComplianceViolationAlert
- ContentFilesResponse
- ContentFilesResponseContent
- ContentJAVAPackageResponse
- ContentJAVAPackageResponseContent
- Correction
- CorrectionFieldMatch
- CorrectionMatch
- CustomJsonPatch
- ECSInventory
- ECSInventoryContainers
- ECSInventoryTasks
- EnterpriseVulnerability
- EnterpriseVulnerabilityResponse
- ImageAncestor
- ImageArtifact
- InventoryItem
- InventoryReport
- InventoryReportImage
- InventoryReportItem
- JsonPatchAdd
- JsonPatchCopy
- JsonPatchMove
- JsonPatchRemove
- JsonPatchReplace
- JsonPatchTest
- KubernetesInventory
- KubernetesInventoryContainers
- KubernetesInventoryNamespaces
- KubernetesInventoryNodes
- KubernetesInventoryPods
- KubernetesNamespaces
- KubernetesNamespacesNamespaces
- ModifiedPackage
- NativeSBOM
- NativeSBOMDescriptor
- NativeSBOMDistribution
- NativeSBOMPackage
- NativeSBOMPackageLocation
- NativeSBOMPackageRelationship
- NativeSBOMSchema
- NativeSBOMSource
- NvdDataObject
- Package
- PolicyEvaluationResult
- RelationshipSbomDiff
- RelationshipType
- ResourceLabel
- RuntimeComplianceCheck
- SBOMVulnerabilitiesResponse
- Source
- SourceContentPackageResponse
- SourceContentPackageResponseContent
- SourceImportContentResponse
- SourceImportMetadata
- SourceImportMetadataContents
- SourceImportOperation
- SourceManifest
- SourceManifestMetadataRecords
- SourceVulnerabilitiesResponse
- VendorDataObject
- VersionVulnerability
- VersionVulnerabilityMatch
- VersionVulnerabilityMatchLocation
- VersionVulnerabilityMatchLocationArtifact
- VersionVulnerabilityMatchLocationPackage
- VersionVulnerabilityNVD
- VersionVulnerabilityNVDAllOf
- VersionVulnerabilityReportImage
- VersionVulnerabilityReportSource
- VersionVulnerabilityVendor
- VersionVulnerabilityVendorAllOf
- VersionVulnerabilityVendorNVDCommon
- VersionVulnerabilityVendorNVDCommonCvss
- Vulnerability
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