Skip to content

Latest commit

 

History

History
284 lines (178 loc) · 6.63 KB

TagsAPI.md

File metadata and controls

284 lines (178 loc) · 6.63 KB

\TagsAPI

All URIs are relative to https://<sub_domain>.api.kandji.io

Method HTTP request Description
CreateTag Post /api/v1/tags Create Tag
DeleteTag Delete /api/v1/tags/{tag_id} Delete Tag
GetTags Get /api/v1/tags Get Tags
UpdateTag Patch /api/v1/tags/{tag_id} Update Tag

CreateTag

TagsCreateTag201Response CreateTag(ctx).Body(body).Execute()

Create Tag

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/MScottBlake/kandji-go-sdk"
)

func main() {
	body := "{"name":"accuhive_01"}" // string |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
body string

Return type

TagsCreateTag201Response

Authorization

bearer

HTTP request headers

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

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

DeleteTag

DeleteTag(ctx, tagId).Execute()

Delete Tag

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/MScottBlake/kandji-go-sdk"
)

func main() {
	tagId := "tagId_example" // string | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
tagId string

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetTags

AutomatedDeviceEnrollmentIntegrationsListAdeDevices200Response GetTags(ctx).Search(search).Execute()

Get Tags

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/MScottBlake/kandji-go-sdk"
)

func main() {
	search := "accuhive" // string | Return resultes containing a given tag search string.

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

Path Parameters

Other Parameters

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

Name Type Description Notes
search string Return resultes containing a given tag search string.

Return type

AutomatedDeviceEnrollmentIntegrationsListAdeDevices200Response

Authorization

bearer

HTTP request headers

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

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

UpdateTag

TagsCreateTag201Response UpdateTag(ctx, tagId).Body(body).Execute()

Update Tag

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/MScottBlake/kandji-go-sdk"
)

func main() {
	tagId := "tagId_example" // string | 
	body := "{"name":"accuhive_02"}" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TagsAPI.UpdateTag(context.Background(), tagId).Body(body).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.UpdateTag``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateTag`: TagsCreateTag201Response
	fmt.Fprintf(os.Stdout, "Response from `TagsAPI.UpdateTag`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
tagId string

Other Parameters

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

Name Type Description Notes

body | string | |

Return type

TagsCreateTag201Response

Authorization

bearer

HTTP request headers

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

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