Skip to content

Latest commit

 

History

History
690 lines (449 loc) · 18.6 KB

TasksAPI.md

File metadata and controls

690 lines (449 loc) · 18.6 KB

\TasksAPI

All URIs are relative to http://localhost

Method HTTP request Description
TasksCreateTask Post /api/tasks/v1/Tasks Create a new task
TasksDeleteTask Delete /api/tasks/v1/Tasks/{taskId} Delete a task from a storage
TasksGet Get /api/tasks/v1/Tasks/{taskId} Get a task by a specified id
TasksGetList Get /api/tasks/v1/Tasks Get tasks list
TasksGetPermissions Get /api/tasks/v1/Tasks/{id}/permissions Get all Task permissions
TasksRenameTask Put /api/tasks/v1/Tasks/{taskId}/rename Rename a task
TasksRunTask Post /api/tasks/v1/Tasks/run Run a task from request body
TasksRunTaskById Post /api/tasks/v1/Tasks/{taskId}/run Run a task by id
TasksUpdatePermissions Post /api/tasks/v1/Tasks/{id}/permissions Update permissions
TasksUpdateTask Put /api/tasks/v1/Tasks/{taskId} Update a task

TasksCreateTask

TaskBaseVM TasksCreateTask(ctx).CreateTaskBaseVM(createTaskBaseVM).Execute()

Create a new task

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/fastreports/gofrcloud"
)

func main() {
	createTaskBaseVM := *openapiclient.NewCreateTaskBaseVM("T_example") // CreateTaskBaseVM | task's view model. You have to specify task type (type: \"ExportTemplate\") (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
createTaskBaseVM CreateTaskBaseVM task's view model. You have to specify task type (type: "ExportTemplate")

Return type

TaskBaseVM

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

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

TasksDeleteTask

TasksDeleteTask(ctx, taskId).Execute()

Delete a task from a storage

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/fastreports/gofrcloud"
)

func main() {
	taskId := "taskId_example" // string | deleting task id

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.TasksAPI.TasksDeleteTask(context.Background(), taskId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TasksAPI.TasksDeleteTask``: %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.
taskId string deleting task id

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

ApiKey, JWT

HTTP request headers

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

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

TasksGet

TaskBaseVM TasksGet(ctx, taskId).Execute()

Get a task by a specified id

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/fastreports/gofrcloud"
)

func main() {
	taskId := "taskId_example" // string | a task id

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
taskId string a task id

Other Parameters

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

Name Type Description Notes

Return type

TaskBaseVM

Authorization

ApiKey, JWT

HTTP request headers

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

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

TasksGetList

TasksVM TasksGetList(ctx).Skip(skip).Take(take).SubscriptionId(subscriptionId).SearchPattern(searchPattern).Execute()

Get tasks list

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/fastreports/gofrcloud"
)

func main() {
	skip := int32(56) // int32 | number of tasks, that have to be skipped (optional) (default to 0)
	take := int32(56) // int32 | number of tasks, that have to be returned (optional) (default to 10)
	subscriptionId := "subscriptionId_example" // string | subscription id (optional)
	searchPattern := "searchPattern_example" // string |  (optional) (default to "")

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TasksAPI.TasksGetList(context.Background()).Skip(skip).Take(take).SubscriptionId(subscriptionId).SearchPattern(searchPattern).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TasksAPI.TasksGetList``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `TasksGetList`: TasksVM
	fmt.Fprintf(os.Stdout, "Response from `TasksAPI.TasksGetList`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
skip int32 number of tasks, that have to be skipped [default to 0]
take int32 number of tasks, that have to be returned [default to 10]
subscriptionId string subscription id
searchPattern string [default to ""]

Return type

TasksVM

Authorization

ApiKey, JWT

HTTP request headers

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

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

TasksGetPermissions

TaskPermissionsVM TasksGetPermissions(ctx, id).Execute()

Get all Task permissions

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/fastreports/gofrcloud"
)

func main() {
	id := "id_example" // string | task id

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

TaskPermissionsVM

Authorization

ApiKey, JWT

HTTP request headers

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

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

TasksRenameTask

TaskBaseVM TasksRenameTask(ctx, taskId).NewName(newName).Execute()

Rename a task

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/fastreports/gofrcloud"
)

func main() {
	taskId := "taskId_example" // string | renaming task id
	newName := "newName_example" // string | task's new Name (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TasksAPI.TasksRenameTask(context.Background(), taskId).NewName(newName).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TasksAPI.TasksRenameTask``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `TasksRenameTask`: TaskBaseVM
	fmt.Fprintf(os.Stdout, "Response from `TasksAPI.TasksRenameTask`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
taskId string renaming task id

Other Parameters

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

Name Type Description Notes

newName | string | task's new Name |

Return type

TaskBaseVM

Authorization

ApiKey, JWT

HTTP request headers

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

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

TasksRunTask

TasksRunTask(ctx).RunTaskBaseVM(runTaskBaseVM).Execute()

Run a task from request body

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/fastreports/gofrcloud"
)

func main() {
	runTaskBaseVM := *openapiclient.NewRunTaskBaseVM("T_example") // RunTaskBaseVM | task's view model (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.TasksAPI.TasksRunTask(context.Background()).RunTaskBaseVM(runTaskBaseVM).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TasksAPI.TasksRunTask``: %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 apiTasksRunTaskRequest struct via the builder pattern

Name Type Description Notes
runTaskBaseVM RunTaskBaseVM task's view model

Return type

(empty response body)

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

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

TasksRunTaskById

TasksRunTaskById(ctx, taskId).Execute()

Run a task by id

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/fastreports/gofrcloud"
)

func main() {
	taskId := "taskId_example" // string | task id

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.TasksAPI.TasksRunTaskById(context.Background(), taskId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TasksAPI.TasksRunTaskById``: %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.
taskId string task id

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

ApiKey, JWT

HTTP request headers

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

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

TasksUpdatePermissions

TasksUpdatePermissions(ctx, id).UpdateTaskPermissionsVM(updateTaskPermissionsVM).Execute()

Update permissions

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/fastreports/gofrcloud"
)

func main() {
	id := "id_example" // string | task id
	updateTaskPermissionsVM := *openapiclient.NewUpdateTaskPermissionsVM(openapiclient.TaskAdministrate(0), *openapiclient.NewTaskPermissionsCRUDVM("T_example"), "T_example") // UpdateTaskPermissionsVM | new permissions (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.TasksAPI.TasksUpdatePermissions(context.Background(), id).UpdateTaskPermissionsVM(updateTaskPermissionsVM).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TasksAPI.TasksUpdatePermissions``: %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 string task id

Other Parameters

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

Name Type Description Notes

updateTaskPermissionsVM | UpdateTaskPermissionsVM | new permissions |

Return type

(empty response body)

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

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

TasksUpdateTask

TaskBaseVM TasksUpdateTask(ctx, taskId).UpdateTaskBaseVM(updateTaskBaseVM).Execute()

Update a task

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/fastreports/gofrcloud"
)

func main() {
	taskId := "taskId_example" // string | updating task id
	updateTaskBaseVM := *openapiclient.NewUpdateTaskBaseVM("T_example") // UpdateTaskBaseVM | task's view model. You have to specify task type (type: \"ExportTemplate\") (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TasksAPI.TasksUpdateTask(context.Background(), taskId).UpdateTaskBaseVM(updateTaskBaseVM).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TasksAPI.TasksUpdateTask``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `TasksUpdateTask`: TaskBaseVM
	fmt.Fprintf(os.Stdout, "Response from `TasksAPI.TasksUpdateTask`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
taskId string updating task id

Other Parameters

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

Name Type Description Notes

updateTaskBaseVM | UpdateTaskBaseVM | task's view model. You have to specify task type (type: "ExportTemplate") |

Return type

TaskBaseVM

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

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