Skip to content

Latest commit

 

History

History
538 lines (334 loc) · 16.9 KB

ComplianceAPI.md

File metadata and controls

538 lines (334 loc) · 16.9 KB

\ComplianceAPI

All URIs are relative to http://localhost

Method HTTP request Description
CountResultsComplianceScan Post /kengine/scan/results/count/compliance Get Compliance Scans Results
IngestComplianceScanStatus Post /kengine/ingest/compliance-scan-logs Ingest Compliance Scan Status
IngestCompliances Post /kengine/ingest/compliance Ingest Compliances
ListComplianceScan Post /kengine/scan/list/compliance Get Compliance Scans List
ResultsComplianceScan Post /kengine/scan/results/compliance Get Compliance Scans Results
StartComplianceScan Post /kengine/scan/start/compliance Start Compliance Scan
StatusComplianceScan Post /kengine/scan/status/compliance Get Compliance Scan Status
StopComplianceScan Post /kengine/scan/stop/compliance Stop Compliance Scan

CountResultsComplianceScan

SearchSearchCountResp CountResultsComplianceScan(ctx).ModelScanResultsReq(modelScanResultsReq).Execute()

Get Compliance Scans Results

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/khulnasoft-lab/golang_sdk/client"
)

func main() {
	modelScanResultsReq := *openapiclient.NewModelScanResultsReq(*openapiclient.NewReportersFieldsFilters([]openapiclient.ReportersCompareFilter{*openapiclient.NewReportersCompareFilter("FieldName_example", interface{}(123), false)}, *openapiclient.NewReportersContainsFilter(map[string][]interface{}{"key": []interface{}{nil}}), *openapiclient.NewReportersMatchFilter(map[string][]interface{}{"key": []interface{}{nil}}), *openapiclient.NewReportersOrderFilter([]openapiclient.ReportersOrderSpec{*openapiclient.NewReportersOrderSpec(false, "FieldName_example")})), "ScanId_example", *openapiclient.NewModelFetchWindow(int32(123), int32(123))) // ModelScanResultsReq |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ComplianceAPI.CountResultsComplianceScan(context.Background()).ModelScanResultsReq(modelScanResultsReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ComplianceAPI.CountResultsComplianceScan``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CountResultsComplianceScan`: SearchSearchCountResp
	fmt.Fprintf(os.Stdout, "Response from `ComplianceAPI.CountResultsComplianceScan`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCountResultsComplianceScanRequest struct via the builder pattern

Name Type Description Notes
modelScanResultsReq ModelScanResultsReq

Return type

SearchSearchCountResp

Authorization

bearer_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

IngestComplianceScanStatus

IngestComplianceScanStatus(ctx).IngestersComplianceScanStatus(ingestersComplianceScanStatus).Execute()

Ingest Compliance Scan Status

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/khulnasoft-lab/golang_sdk/client"
)

func main() {
	ingestersComplianceScanStatus := []openapiclient.IngestersComplianceScanStatus{*openapiclient.NewIngestersComplianceScanStatus()} // []IngestersComplianceScanStatus |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.ComplianceAPI.IngestComplianceScanStatus(context.Background()).IngestersComplianceScanStatus(ingestersComplianceScanStatus).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ComplianceAPI.IngestComplianceScanStatus``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiIngestComplianceScanStatusRequest struct via the builder pattern

Name Type Description Notes
ingestersComplianceScanStatus []IngestersComplianceScanStatus

Return type

(empty response body)

Authorization

bearer_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

IngestCompliances

IngestCompliances(ctx).IngestersCompliance(ingestersCompliance).Execute()

Ingest Compliances

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/khulnasoft-lab/golang_sdk/client"
)

func main() {
	ingestersCompliance := []openapiclient.IngestersCompliance{*openapiclient.NewIngestersCompliance()} // []IngestersCompliance |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.ComplianceAPI.IngestCompliances(context.Background()).IngestersCompliance(ingestersCompliance).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ComplianceAPI.IngestCompliances``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiIngestCompliancesRequest struct via the builder pattern

Name Type Description Notes
ingestersCompliance []IngestersCompliance

Return type

(empty response body)

Authorization

bearer_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListComplianceScan

ModelScanListResp ListComplianceScan(ctx).ModelScanListReq(modelScanListReq).Execute()

Get Compliance Scans List

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/khulnasoft-lab/golang_sdk/client"
)

func main() {
	modelScanListReq := *openapiclient.NewModelScanListReq(*openapiclient.NewReportersFieldsFilters([]openapiclient.ReportersCompareFilter{*openapiclient.NewReportersCompareFilter("FieldName_example", interface{}(123), false)}, *openapiclient.NewReportersContainsFilter(map[string][]interface{}{"key": []interface{}{nil}}), *openapiclient.NewReportersMatchFilter(map[string][]interface{}{"key": []interface{}{nil}}), *openapiclient.NewReportersOrderFilter([]openapiclient.ReportersOrderSpec{*openapiclient.NewReportersOrderSpec(false, "FieldName_example")})), []openapiclient.ModelNodeIdentifier{*openapiclient.NewModelNodeIdentifier("NodeId_example", "NodeType_example")}, *openapiclient.NewModelFetchWindow(int32(123), int32(123))) // ModelScanListReq |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ComplianceAPI.ListComplianceScan(context.Background()).ModelScanListReq(modelScanListReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ComplianceAPI.ListComplianceScan``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListComplianceScan`: ModelScanListResp
	fmt.Fprintf(os.Stdout, "Response from `ComplianceAPI.ListComplianceScan`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListComplianceScanRequest struct via the builder pattern

Name Type Description Notes
modelScanListReq ModelScanListReq

Return type

ModelScanListResp

Authorization

bearer_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ResultsComplianceScan

ModelComplianceScanResult ResultsComplianceScan(ctx).ModelScanResultsReq(modelScanResultsReq).Execute()

Get Compliance Scans Results

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/khulnasoft-lab/golang_sdk/client"
)

func main() {
	modelScanResultsReq := *openapiclient.NewModelScanResultsReq(*openapiclient.NewReportersFieldsFilters([]openapiclient.ReportersCompareFilter{*openapiclient.NewReportersCompareFilter("FieldName_example", interface{}(123), false)}, *openapiclient.NewReportersContainsFilter(map[string][]interface{}{"key": []interface{}{nil}}), *openapiclient.NewReportersMatchFilter(map[string][]interface{}{"key": []interface{}{nil}}), *openapiclient.NewReportersOrderFilter([]openapiclient.ReportersOrderSpec{*openapiclient.NewReportersOrderSpec(false, "FieldName_example")})), "ScanId_example", *openapiclient.NewModelFetchWindow(int32(123), int32(123))) // ModelScanResultsReq |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ComplianceAPI.ResultsComplianceScan(context.Background()).ModelScanResultsReq(modelScanResultsReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ComplianceAPI.ResultsComplianceScan``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ResultsComplianceScan`: ModelComplianceScanResult
	fmt.Fprintf(os.Stdout, "Response from `ComplianceAPI.ResultsComplianceScan`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiResultsComplianceScanRequest struct via the builder pattern

Name Type Description Notes
modelScanResultsReq ModelScanResultsReq

Return type

ModelComplianceScanResult

Authorization

bearer_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

StartComplianceScan

ModelScanTriggerResp StartComplianceScan(ctx).ModelComplianceScanTriggerReq(modelComplianceScanTriggerReq).Execute()

Start Compliance Scan

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/khulnasoft-lab/golang_sdk/client"
)

func main() {
	modelComplianceScanTriggerReq := *openapiclient.NewModelComplianceScanTriggerReq([]string{"BenchmarkTypes_example"}, *openapiclient.NewModelScanFilter(*openapiclient.NewReportersContainsFilter(map[string][]interface{}{"key": []interface{}{nil}}), *openapiclient.NewReportersContainsFilter(map[string][]interface{}{"key": []interface{}{nil}}), *openapiclient.NewReportersContainsFilter(map[string][]interface{}{"key": []interface{}{nil}}), *openapiclient.NewReportersContainsFilter(map[string][]interface{}{"key": []interface{}{nil}}), *openapiclient.NewReportersContainsFilter(map[string][]interface{}{"key": []interface{}{nil}})), []openapiclient.ModelNodeIdentifier{*openapiclient.NewModelNodeIdentifier("NodeId_example", "NodeType_example")}) // ModelComplianceScanTriggerReq |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ComplianceAPI.StartComplianceScan(context.Background()).ModelComplianceScanTriggerReq(modelComplianceScanTriggerReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ComplianceAPI.StartComplianceScan``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `StartComplianceScan`: ModelScanTriggerResp
	fmt.Fprintf(os.Stdout, "Response from `ComplianceAPI.StartComplianceScan`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiStartComplianceScanRequest struct via the builder pattern

Name Type Description Notes
modelComplianceScanTriggerReq ModelComplianceScanTriggerReq

Return type

ModelScanTriggerResp

Authorization

bearer_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

StatusComplianceScan

ModelScanStatusResp StatusComplianceScan(ctx).ModelScanStatusReq(modelScanStatusReq).Execute()

Get Compliance Scan Status

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/khulnasoft-lab/golang_sdk/client"
)

func main() {
	modelScanStatusReq := *openapiclient.NewModelScanStatusReq("BulkScanId_example", []string{"ScanIds_example"}) // ModelScanStatusReq |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ComplianceAPI.StatusComplianceScan(context.Background()).ModelScanStatusReq(modelScanStatusReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ComplianceAPI.StatusComplianceScan``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `StatusComplianceScan`: ModelScanStatusResp
	fmt.Fprintf(os.Stdout, "Response from `ComplianceAPI.StatusComplianceScan`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiStatusComplianceScanRequest struct via the builder pattern

Name Type Description Notes
modelScanStatusReq ModelScanStatusReq

Return type

ModelScanStatusResp

Authorization

bearer_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

StopComplianceScan

StopComplianceScan(ctx).ModelStopScanRequest(modelStopScanRequest).Execute()

Stop Compliance Scan

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/khulnasoft-lab/golang_sdk/client"
)

func main() {
	modelStopScanRequest := *openapiclient.NewModelStopScanRequest([]string{"ScanIds_example"}, "ScanType_example") // ModelStopScanRequest |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.ComplianceAPI.StopComplianceScan(context.Background()).ModelStopScanRequest(modelStopScanRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ComplianceAPI.StopComplianceScan``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiStopComplianceScanRequest struct via the builder pattern

Name Type Description Notes
modelStopScanRequest ModelStopScanRequest

Return type

(empty response body)

Authorization

bearer_token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]