# README
Go API client for engine
This is the Nextlinux Engine API. Provides the primary external API for users of the service.
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.6.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 "./engine"
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
Class | Method | HTTP request | Description |
---|---|---|---|
ArchivesApi | ArchiveImageAnalysis | Post /archives/images | |
ArchivesApi | CreateAnalysisArchiveRule | Post /archives/rules | |
ArchivesApi | DeleteAnalysisArchiveRule | Delete /archives/rules/{ruleId} | |
ArchivesApi | DeleteArchivedAnalysis | Delete /archives/images/{imageDigest} | |
ArchivesApi | GetAnalysisArchiveRule | Get /archives/rules/{ruleId} | |
ArchivesApi | GetArchivedAnalysis | Get /archives/images/{imageDigest} | |
ArchivesApi | ListAnalysisArchive | Get /archives/images | |
ArchivesApi | ListAnalysisArchiveRules | Get /archives/rules | |
ArchivesApi | ListArchives | Get /archives | |
DefaultApi | GetOauthToken | Post /oauth/token | |
DefaultApi | HealthCheck | Get /health | |
DefaultApi | ListFileContentSearchResults | Get /images/{imageDigest}/artifacts/file_content_search | Return a list of analyzer artifacts of the specified type |
DefaultApi | ListRetrievedFiles | Get /images/{imageDigest}/artifacts/retrieved_files | Return a list of analyzer artifacts of the specified type |
DefaultApi | ListSecretSearchResults | Get /images/{imageDigest}/artifacts/secret_search | Return a list of analyzer artifacts of the specified type |
DefaultApi | Ping | Get / | |
DefaultApi | RevokeOauthToken | Post /oauth/revoke | |
DefaultApi | VersionCheck | Get /version | |
EventsApi | DeleteEvent | Delete /events/{eventId} | Delete Event |
EventsApi | DeleteEvents | Delete /events | Delete Events |
EventsApi | GetEvent | Get /events/{eventId} | Get Event |
EventsApi | ListEventTypes | Get /event_types | List Event Types |
EventsApi | ListEvents | Get /events | List Events |
IdentityApi | AddCredential | Post /user/credentials | add/replace credential |
IdentityApi | GetCredentials | Get /user/credentials | Get current credential summary |
IdentityApi | GetUser | Get /user | List authenticated user info |
IdentityApi | GetUsersAccount | Get /account | List the account for the authenticated user |
ImagesApi | AddImage | Post /images | Submit a new image for analysis by the engine |
ImagesApi | DeleteImage | Delete /images/{imageDigest} | Delete an image analysis |
ImagesApi | DeleteImageByImageId | Delete /images/by_id/{imageId} | Delete image by docker imageId |
ImagesApi | DeleteImagesAsync | Delete /images | Bulk mark images for deletion |
ImagesApi | GetImage | Get /images/{imageDigest} | Get image metadata |
ImagesApi | GetImageByImageId | Get /images/by_id/{imageId} | Lookup image by docker imageId |
ImagesApi | GetImageContentByType | Get /images/{imageDigest}/content/{ctype} | Get the content of an image by type |
ImagesApi | GetImageContentByTypeFiles | Get /images/{imageDigest}/content/files | Get the content of an image by type files |
ImagesApi | GetImageContentByTypeImageId | Get /images/by_id/{imageId}/content/{ctype} | Get the content of an image by type |
ImagesApi | GetImageContentByTypeImageIdFiles | Get /images/by_id/{imageId}/content/files | Get the content of an image by type files |
ImagesApi | GetImageContentByTypeImageIdJavapackage | Get /images/by_id/{imageId}/content/java | Get the content of an image by type java |
ImagesApi | GetImageContentByTypeJavapackage | Get /images/{imageDigest}/content/java | Get the content of an image by type java |
ImagesApi | GetImageContentByTypeMalware | Get /images/{imageDigest}/content/malware | Get the content of an image by type malware |
ImagesApi | GetImageMetadataByType | Get /images/{imageDigest}/metadata/{mtype} | Get the metadata of an image by type |
ImagesApi | GetImagePolicyCheck | Get /images/{imageDigest}/check | Check policy evaluation status for image |
ImagesApi | GetImagePolicyCheckByImageId | Get /images/by_id/{imageId}/check | Check policy evaluation status for image |
ImagesApi | GetImageSbomCyclonedxJson | Get /images/{imageDigest}/sboms/cyclonedx-json | Get image sbom in the CycloneDX format |
ImagesApi | GetImageSbomNative | Get /images/{imageDigest}/sboms/native | Get image sbom in the native Nextlinux format |
ImagesApi | GetImageSbomNativeJson | Get /images/{imageDigest}/sboms/native-json | Get image sbom in the native Nextlinux format |
ImagesApi | GetImageSbomSpdxJson | Get /images/{imageDigest}/sboms/spdx-json | Get image sbom in the SPDX format |
ImagesApi | GetImageVulnerabilitiesByType | Get /images/{imageDigest}/vuln/{vtype} | Get vulnerabilities by type |
ImagesApi | GetImageVulnerabilitiesByTypeImageId | Get /images/by_id/{imageId}/vuln/{vtype} | Get vulnerabilities by type |
ImagesApi | GetImageVulnerabilityTypes | Get /images/{imageDigest}/vuln | Get vulnerability types |
ImagesApi | GetImageVulnerabilityTypesByImageId | Get /images/by_id/{imageId}/vuln | Get vulnerability types |
ImagesApi | ListImageContent | Get /images/{imageDigest}/content | List image content types |
ImagesApi | ListImageContentByImageid | Get /images/by_id/{imageId}/content | List image content types |
ImagesApi | ListImageMetadata | Get /images/{imageDigest}/metadata | List image metadata types |
ImagesApi | ListImages | Get /images | List all visible images |
ImportApi | ImportImageArchive | Post /import/images | Import an nextlinux image tar.gz archive file. This is a deprecated API replaced by the "/imports/images" route |
ImportsApi | CreateOperation | Post /imports/images | Begin the import of an image SBOM into the system |
ImportsApi | GetOperation | Get /imports/images/{operation_id} | Get detail on a single import |
ImportsApi | ImportContentSearches | Post /imports/images/{operation_id}/content_searches | Import a content search analysis catalog |
ImportsApi | ImportFileContents | Post /imports/images/{operation_id}/file_contents | Import a file contents analysis catalog |
ImportsApi | ImportImageConfig | Post /imports/images/{operation_id}/image_config | Import a docker or OCI image config to associate with the image |
ImportsApi | ImportImageDockerfile | Post /imports/images/{operation_id}/dockerfile | Begin the import of an image analyzed by Syft into the system |
ImportsApi | ImportImageManifest | Post /imports/images/{operation_id}/manifest | Import a docker or OCI distribution manifest to associate with the image |
ImportsApi | ImportImagePackages | Post /imports/images/{operation_id}/packages | Begin the import of an image analyzed by Syft into the system |
ImportsApi | ImportImageParentManifest | Post /imports/images/{operation_id}/parent_manifest | Import a docker or OCI distribution manifest list to associate with the image |
ImportsApi | ImportSecretSearches | Post /imports/images/{operation_id}/secret_searches | Import a secret search analysis catalog |
ImportsApi | InvalidateOperation | Delete /imports/images/{operation_id} | Invalidate operation ID so it can be garbage collected |
ImportsApi | ListImportContentSearches | Get /imports/images/{operation_id}/content_searches | List uploaded content search results |
ImportsApi | ListImportDockerfiles | Get /imports/images/{operation_id}/dockerfile | List uploaded dockerfiles |
ImportsApi | ListImportFileContents | Get /imports/images/{operation_id}/file_contents | List uploaded file contents |
ImportsApi | ListImportImageConfigs | Get /imports/images/{operation_id}/image_config | List uploaded image configs |
ImportsApi | ListImportImageManifests | Get /imports/images/{operation_id}/manifest | List uploaded image manifests |
ImportsApi | ListImportPackages | Get /imports/images/{operation_id}/packages | List uploaded package manifests |
ImportsApi | ListImportParentManifests | Get /imports/images/{operation_id}/parent_manifest | List uploaded parent manifests (manifest lists for a tag) |
ImportsApi | ListImportSecretSearches | Get /imports/images/{operation_id}/secret_searches | List uploaded secret search results |
ImportsApi | ListOperations | Get /imports/images | Lists in-progress imports |
PoliciesApi | AddPolicy | Post /policies | Add a new policy |
PoliciesApi | DeletePolicy | Delete /policies/{policyId} | Delete policy |
PoliciesApi | GetPolicy | Get /policies/{policyId} | Get specific policy |
PoliciesApi | ListPolicies | Get /policies | List policies |
PoliciesApi | UpdatePolicy | Put /policies/{policyId} | Update policy |
QueryApi | QueryImagesByPackage | Get /query/images/by_package | List of images containing given package |
QueryApi | QueryImagesByVulnerability | Get /query/images/by_vulnerability | List images vulnerable to the specific vulnerability ID. |
QueryApi | QueryVulnerabilities | Get /query/vulnerabilities | Listing information about given vulnerability |
RegistriesApi | CreateRegistry | Post /registries | Add a new registry |
RegistriesApi | DeleteRegistry | Delete /registries/{registry} | Delete a registry configuration |
RegistriesApi | GetRegistry | Get /registries/{registry} | Get a specific registry configuration |
RegistriesApi | ListRegistries | Get /registries | List configured registries |
RegistriesApi | UpdateRegistry | Put /registries/{registry} | Update/replace a registry configuration |
RepositoryCredentialsApi | AddRepository | Post /repositories | Add repository to watch |
SubscriptionsApi | AddSubscription | Post /subscriptions | Add a subscription of a specific type |
SubscriptionsApi | DeleteSubscription | Delete /subscriptions/{subscriptionId} | Delete subscriptions of a specific type |
SubscriptionsApi | GetSubscription | Get /subscriptions/{subscriptionId} | Get a specific subscription set |
SubscriptionsApi | ListSubscriptions | Get /subscriptions | List all subscriptions |
SubscriptionsApi | UpdateSubscription | Put /subscriptions/{subscriptionId} | Update an existing and specific subscription |
SummariesApi | ListImagetags | Get /summaries/imagetags | List all visible image digests and tags |
SystemApi | DeleteFeed | Delete /system/feeds/{feed} | |
SystemApi | DeleteFeedGroup | Delete /system/feeds/{feed}/{group} | |
SystemApi | DeleteService | Delete /system/services/{servicename}/{hostid} | Delete the service config |
SystemApi | DescribeErrorCodes | Get /system/error_codes | Describe nextlinux engine error codes. |
SystemApi | DescribePolicy | Get /system/policy_spec | Describe the policy language spec implemented by this service. |
SystemApi | GetServiceDetail | Get /system | System status |
SystemApi | GetServicesByName | Get /system/services/{servicename} | Get a service configuration and state |
SystemApi | GetServicesByNameAndHost | Get /system/services/{servicename}/{hostid} | Get service config for a specific host |
SystemApi | GetStatus | Get /status | Service status |
SystemApi | GetSystemFeeds | Get /system/feeds | list feeds operations and information |
SystemApi | ListServices | Get /system/services | List system services |
SystemApi | PostSystemFeeds | Post /system/feeds | trigger feeds operations |
SystemApi | TestWebhook | Post /system/webhooks/{webhook_type}/test | Adds the capabilities to test a webhook delivery for the given notification type |
SystemApi | ToggleFeedEnabled | Put /system/feeds/{feed} | |
SystemApi | ToggleGroupEnabled | Put /system/feeds/{feed}/{group} | |
UserManagementApi | CreateAccount | Post /accounts | Create a new account. Only available to admin user. |
UserManagementApi | CreateUser | Post /accounts/{accountname}/users | Create a new user within the specified account. |
UserManagementApi | CreateUserCredential | Post /accounts/{accountname}/users/{username}/credentials | add/replace credential |
UserManagementApi | DeleteAccount | Delete /accounts/{accountname} | Delete the specified account, only allowed if the account is in the disabled state. All users will be deleted along with the account and all resources will be garbage collected |
UserManagementApi | DeleteUser | Delete /accounts/{accountname}/users/{username} | Delete a specific user credential by username of the credential. Cannot be the credential used to authenticate the request. |
UserManagementApi | DeleteUserCredential | Delete /accounts/{accountname}/users/{username}/credentials | Delete a credential by type |
UserManagementApi | GetAccount | Get /accounts/{accountname} | Get account info about this specific account. |
UserManagementApi | GetAccountUser | Get /accounts/{accountname}/users/{username} | Get a specific user in the specified account |
UserManagementApi | ListAccounts | Get /accounts | List account summaries. Only available to the system admin user. |
UserManagementApi | ListUserCredentials | Get /accounts/{accountname}/users/{username}/credentials | Get current credential summary |
UserManagementApi | ListUsers | Get /accounts/{accountname}/users | List of users found in this account. |
UserManagementApi | UpdateAccount | Put /accounts/{accountname} | Update the info for this specific account. |
UserManagementApi | UpdateAccountState | Put /accounts/{accountname}/state | Update the state of an account to either enabled or disabled. For deletion use the DELETE route |
Documentation For Models
- AccessCredential
- Account
- AccountCreationRequest
- AccountInfo
- AccountStatus
- AnalysisArchiveAddResult
- AnalysisArchiveRulesSummary
- AnalysisArchiveSource
- AnalysisArchiveSummary
- AnalysisArchiveTransitionHistory
- AnalysisArchiveTransitionRule
- AnalysisArchiveTransitionRuleExclude
- AnalysisStatusDetail
- AnalysisUpdateEval
- AnalysisUpdateNotification
- AnalysisUpdateNotificationAllOf
- AnalysisUpdateNotificationData
- AnalysisUpdateNotificationDataAllOf
- AnalysisUpdateNotificationPayload
- AnalysisUpdateNotificationPayloadAllOf
- NextlinuxErrorCode
- NextlinuxImage
- NextlinuxImageTagSummary
- ApiErrorResponse
- ArchiveSummary
- ArchiveTagEntry
- ArchivedAnalysis
- BaseNotificationData
- CVSSV2Scores
- CVSSV3Scores
- ContentFilesResponse
- ContentFilesResponseContent
- ContentJAVAPackageResponse
- ContentJAVAPackageResponseContent
- ContentMalwareResponse
- ContentPackageResponse
- ContentPackageResponseContent
- ContentResponse
- DeleteImageResponse
- EventCategory
- EventDescription
- EventResponse
- EventResponseEvent
- EventResponseEventResource
- EventResponseEventSource
- EventSubcategory
- EventsList
- FeedGroupMetadata
- FeedMetadata
- FeedSyncResult
- FileContentSearchResult
- GateSpec
- GenericNotificationPayload
- GroupSyncResult
- ImageAnalysisRequest
- ImageDetail
- ImageFilter
- ImageImportContentResponse
- ImageImportContentSearch
- ImageImportFileContent
- ImageImportFileCoordinate
- ImageImportManifest
- ImageImportOperation
- ImagePackageManifest
- ImageRef
- ImageReference
- ImageSelectionRule
- ImageSelector
- ImageSource
- ImageWithPackages
- ImportContentDigests
- ImportContentSearchElement
- ImportDescriptor
- ImportDistribution
- ImportFile
- ImportFileDigest
- ImportPackage
- ImportPackageLocation
- ImportPackageRelationship
- ImportSchema
- ImportSource
- InlineResponse400
- LocalAnalysisSource
- MalwareScan
- MalwareScanFindings
- MappingRule
- MetadataResponse
- NotificationBase
- NvdDataObject
- PackageReference
- PaginatedImageList
- PaginatedImageListAllOf
- PaginatedVulnerabilityList
- PaginatedVulnerabilityListAllOf
- PaginatedVulnerableImageList
- PaginatedVulnerableImageListAllOf
- PaginationProperties
- Policy
- PolicyBundle
- PolicyBundleRecord
- PolicyEvalNotification
- PolicyEvalNotificationAllOf
- PolicyEvalNotificationData
- PolicyEvalNotificationDataAllOf
- PolicyEvalNotificationPayload
- PolicyEvalNotificationPayloadAllOf
- PolicyRule
- PolicyRuleParams
- RegexContentMatch
- RegistryConfiguration
- RegistryConfigurationRequest
- RegistryDigestSource
- RegistryTagSource
- RetrievedFile
- SecretSearchResult
- Service
- ServiceReference
- ServiceVersion
- ServiceVersionApi
- ServiceVersionDb
- ServiceVersionService
- SourceMappingRule
- StandaloneVulnerability
- StatusResponse
- Subscription
- SubscriptionRequest
- SubscriptionUpdate
- SystemStatusResponse
- TagEntry
- TagUpdateNotification
- TagUpdateNotificationAllOf
- TagUpdateNotificationData
- TagUpdateNotificationDataAllOf
- TagUpdateNotificationPayload
- TagUpdateNotificationPayloadAllOf
- TokenResponse
- TriggerParamSpec
- TriggerSpec
- User
- UserCreationRequest
- VendorDataObject
- VulnDiffResult
- VulnUpdateNotification
- VulnUpdateNotificationAllOf
- VulnUpdateNotificationData
- VulnUpdateNotificationDataAllOf
- VulnUpdateNotificationPayload
- VulnUpdateNotificationPayloadAllOf
- Vulnerability
- VulnerabilityReference
- VulnerabilityResponse
- VulnerableImage
- VulnerablePackageReference
- Whitelist
- WhitelistItem
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