Skip to content

Latest commit

 

History

History
269 lines (169 loc) · 6.32 KB

CommandAPI.md

File metadata and controls

269 lines (169 loc) · 6.32 KB

\CommandAPI

All URIs are relative to http://localhost:8989

Method HTTP request Description
CreateCommand Post /api/v3/command
DeleteCommand Delete /api/v3/command/{id}
GetCommandById Get /api/v3/command/{id}
ListCommand Get /api/v3/command

CreateCommand

CommandResource CreateCommand(ctx).CommandResource(commandResource).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {
	commandResource := *sonarrClient.NewCommandResource() // CommandResource |  (optional)

	configuration := sonarrClient.NewConfiguration()
	apiClient := sonarrClient.NewAPIClient(configuration)
	resp, r, err := apiClient.CommandAPI.CreateCommand(context.Background()).CommandResource(commandResource).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CommandAPI.CreateCommand``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateCommand`: CommandResource
	fmt.Fprintf(os.Stdout, "Response from `CommandAPI.CreateCommand`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
commandResource CommandResource

Return type

CommandResource

Authorization

apikey, X-Api-Key

HTTP request headers

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

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

DeleteCommand

DeleteCommand(ctx, id).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {
	id := int32(56) // int32 | 

	configuration := sonarrClient.NewConfiguration()
	apiClient := sonarrClient.NewAPIClient(configuration)
	r, err := apiClient.CommandAPI.DeleteCommand(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CommandAPI.DeleteCommand``: %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.
id int32

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

apikey, X-Api-Key

HTTP request headers

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

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

GetCommandById

CommandResource GetCommandById(ctx, id).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {
	id := int32(56) // int32 | 

	configuration := sonarrClient.NewConfiguration()
	apiClient := sonarrClient.NewAPIClient(configuration)
	resp, r, err := apiClient.CommandAPI.GetCommandById(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CommandAPI.GetCommandById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetCommandById`: CommandResource
	fmt.Fprintf(os.Stdout, "Response from `CommandAPI.GetCommandById`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

CommandResource

Authorization

apikey, X-Api-Key

HTTP request headers

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

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

ListCommand

[]CommandResource ListCommand(ctx).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonarrClient "github.com/devopsarr/sonarr-go/sonarr"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]CommandResource

Authorization

apikey, X-Api-Key

HTTP request headers

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

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