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 |
CommandResource CreateCommand(ctx).CommandResource(commandResource).Execute()
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)
}
Other parameters are passed through a pointer to a apiCreateCommandRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
commandResource | CommandResource |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteCommand(ctx, id).Execute()
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)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int32 |
Other parameters are passed through a pointer to a apiDeleteCommandRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CommandResource GetCommandById(ctx, id).Execute()
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)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int32 |
Other parameters are passed through a pointer to a apiGetCommandByIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]CommandResource ListCommand(ctx).Execute()
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)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListCommandRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]