Skip to content

Latest commit

 

History

History
142 lines (88 loc) · 4.2 KB

ThreatAPI.md

File metadata and controls

142 lines (88 loc) · 4.2 KB

\ThreatAPI

All URIs are relative to http://localhost

Method HTTP request Description
GetIndividualThreatGraph Post /kengine/graph/threat/individual Get Vulnerability Threat Graph
GetThreatGraph Post /kengine/graph/threat Get Threat Graph

GetIndividualThreatGraph

[]GraphIndividualThreatGraph GetIndividualThreatGraph(ctx).GraphIndividualThreatGraphRequest(graphIndividualThreatGraphRequest).Execute()

Get Vulnerability Threat Graph

Example

package main

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

func main() {
	graphIndividualThreatGraphRequest := *openapiclient.NewGraphIndividualThreatGraphRequest("GraphType_example", "IssueType_example") // GraphIndividualThreatGraphRequest |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ThreatAPI.GetIndividualThreatGraph(context.Background()).GraphIndividualThreatGraphRequest(graphIndividualThreatGraphRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ThreatAPI.GetIndividualThreatGraph``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetIndividualThreatGraph`: []GraphIndividualThreatGraph
	fmt.Fprintf(os.Stdout, "Response from `ThreatAPI.GetIndividualThreatGraph`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
graphIndividualThreatGraphRequest GraphIndividualThreatGraphRequest

Return type

[]GraphIndividualThreatGraph

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]

GetThreatGraph

map[string]GraphProviderThreatGraph GetThreatGraph(ctx).GraphThreatFilters(graphThreatFilters).Execute()

Get Threat Graph

Example

package main

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

func main() {
	graphThreatFilters := *openapiclient.NewGraphThreatFilters(*openapiclient.NewGraphCloudProviderFilter([]string{"AccountIds_example"}), *openapiclient.NewGraphCloudProviderFilter([]string{"AccountIds_example"}), false, *openapiclient.NewGraphCloudProviderFilter([]string{"AccountIds_example"}), "Type_example") // GraphThreatFilters |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ThreatAPI.GetThreatGraph(context.Background()).GraphThreatFilters(graphThreatFilters).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ThreatAPI.GetThreatGraph``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetThreatGraph`: map[string]GraphProviderThreatGraph
	fmt.Fprintf(os.Stdout, "Response from `ThreatAPI.GetThreatGraph`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
graphThreatFilters GraphThreatFilters

Return type

map[string]GraphProviderThreatGraph

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]