Skip to content

Latest commit

 

History

History
780 lines (493 loc) · 30.1 KB

PreheatApi.md

File metadata and controls

780 lines (493 loc) · 30.1 KB

\PreheatApi

All URIs are relative to http://localhost/api/v2.0

Method HTTP request Description
CreateInstance Post /p2p/preheat/instances Create p2p provider instances
CreatePolicy Post /projects/{project_name}/preheat/policies Create a preheat policy under a project
DeleteInstance Delete /p2p/preheat/instances/{preheat_instance_name} Delete the specified P2P provider instance
DeletePolicy Delete /projects/{project_name}/preheat/policies/{preheat_policy_name} Delete a preheat policy
GetExecution Get /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id} Get a execution detail by id
GetInstance Get /p2p/preheat/instances/{preheat_instance_name} Get a P2P provider instance
GetPolicy Get /projects/{project_name}/preheat/policies/{preheat_policy_name} Get a preheat policy
GetPreheatLog Get /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks/{task_id}/logs Get the log text stream of the specified task for the given execution
ListExecutions Get /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions List executions for the given policy
ListInstances Get /p2p/preheat/instances List P2P provider instances
ListPolicies Get /projects/{project_name}/preheat/policies List preheat policies
ListProviders Get /p2p/preheat/providers List P2P providers
ListProvidersUnderProject Get /projects/{project_name}/preheat/providers Get all providers at project level
ListTasks Get /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks List all the related tasks for the given execution
ManualPreheat Post /projects/{project_name}/preheat/policies/{preheat_policy_name} Manual preheat
PingInstances Post /p2p/preheat/instances/ping Ping status of a instance.
StopExecution Patch /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id} Stop a execution
UpdateInstance Put /p2p/preheat/instances/{preheat_instance_name} Update the specified P2P provider instance
UpdatePolicy Put /projects/{project_name}/preheat/policies/{preheat_policy_name} Update preheat policy

CreateInstance

CreateInstance(ctx, instance, optional) Create p2p provider instances

Create p2p provider instances

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instance Instance The JSON object of instance.
optional *PreheatApiCreateInstanceOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiCreateInstanceOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

(empty response body)

Authorization

basic

HTTP request headers

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

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

CreatePolicy

CreatePolicy(ctx, projectName, policy, optional) Create a preheat policy under a project

Create a preheat policy under a project

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
policy PreheatPolicy The policy schema info
optional *PreheatApiCreatePolicyOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiCreatePolicyOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

(empty response body)

Authorization

basic

HTTP request headers

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

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

DeleteInstance

DeleteInstance(ctx, preheatInstanceName, optional) Delete the specified P2P provider instance

Delete the specified P2P provider instance

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
preheatInstanceName string Instance Name
optional *PreheatApiDeleteInstanceOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiDeleteInstanceOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

(empty response body)

Authorization

basic

HTTP request headers

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

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

DeletePolicy

DeletePolicy(ctx, projectName, preheatPolicyName, optional) Delete a preheat policy

Delete a preheat policy

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
preheatPolicyName string Preheat Policy Name
optional *PreheatApiDeletePolicyOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiDeletePolicyOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

(empty response body)

Authorization

basic

HTTP request headers

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

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

GetExecution

Execution GetExecution(ctx, projectName, preheatPolicyName, executionId, optional) Get a execution detail by id

Get a execution detail by id

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
preheatPolicyName string Preheat Policy Name
executionId int32 Execution ID
optional *PreheatApiGetExecutionOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiGetExecutionOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

Execution

Authorization

basic

HTTP request headers

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

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

GetInstance

Instance GetInstance(ctx, preheatInstanceName, optional) Get a P2P provider instance

Get a P2P provider instance

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
preheatInstanceName string Instance Name
optional *PreheatApiGetInstanceOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiGetInstanceOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

Instance

Authorization

basic

HTTP request headers

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

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

GetPolicy

PreheatPolicy GetPolicy(ctx, projectName, preheatPolicyName, optional) Get a preheat policy

Get a preheat policy

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
preheatPolicyName string Preheat Policy Name
optional *PreheatApiGetPolicyOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiGetPolicyOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

PreheatPolicy

Authorization

basic

HTTP request headers

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

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

GetPreheatLog

string GetPreheatLog(ctx, projectName, preheatPolicyName, executionId, taskId, optional) Get the log text stream of the specified task for the given execution

Get the log text stream of the specified task for the given execution

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
preheatPolicyName string Preheat Policy Name
executionId int32 Execution ID
taskId int32 Task ID
optional *PreheatApiGetPreheatLogOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiGetPreheatLogOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

string

Authorization

basic

HTTP request headers

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

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

ListExecutions

[]Execution ListExecutions(ctx, projectName, preheatPolicyName, optional) List executions for the given policy

List executions for the given policy

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
preheatPolicyName string Preheat Policy Name
optional *PreheatApiListExecutionsOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiListExecutionsOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | page | optional.Int64| The page number | [default to 1] pageSize | optional.Int64| The size of per page | [default to 10] q | optional.String| Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=v)", "range(k=[minmax])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=v2,k3=[minmax] | sort | optional.String| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with "sort=field1,-field2" |

Return type

[]Execution

Authorization

basic

HTTP request headers

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

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

ListInstances

[]Instance ListInstances(ctx, optional) List P2P provider instances

List P2P provider instances

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional *PreheatApiListInstancesOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiListInstancesOpts struct

Name Type Description Notes
xRequestId optional.String An unique ID for the request
page optional.Int64 The page number [default to 1]
pageSize optional.Int64 The size of per page [default to 10]
q optional.String Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=v)", "range(k=[minmax])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=v2,k3=[minmax]
sort optional.String Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with "sort=field1,-field2"

Return type

[]Instance

Authorization

basic

HTTP request headers

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

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

ListPolicies

[]PreheatPolicy ListPolicies(ctx, projectName, optional) List preheat policies

List preheat policies

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
optional *PreheatApiListPoliciesOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiListPoliciesOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | page | optional.Int64| The page number | [default to 1] pageSize | optional.Int64| The size of per page | [default to 10] q | optional.String| Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=v)", "range(k=[minmax])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=v2,k3=[minmax] | sort | optional.String| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with "sort=field1,-field2" |

Return type

[]PreheatPolicy

Authorization

basic

HTTP request headers

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

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

ListProviders

[]Metadata ListProviders(ctx, optional) List P2P providers

List P2P providers

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional *PreheatApiListProvidersOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiListProvidersOpts struct

Name Type Description Notes
xRequestId optional.String An unique ID for the request

Return type

[]Metadata

Authorization

basic

HTTP request headers

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

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

ListProvidersUnderProject

[]ProviderUnderProject ListProvidersUnderProject(ctx, projectName, optional) Get all providers at project level

Get all providers at project level

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
optional *PreheatApiListProvidersUnderProjectOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiListProvidersUnderProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

[]ProviderUnderProject

Authorization

basic

HTTP request headers

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

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

ListTasks

[]Task ListTasks(ctx, projectName, preheatPolicyName, executionId, optional) List all the related tasks for the given execution

List all the related tasks for the given execution

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
preheatPolicyName string Preheat Policy Name
executionId int32 Execution ID
optional *PreheatApiListTasksOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiListTasksOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | page | optional.Int64| The page number | [default to 1] pageSize | optional.Int64| The size of per page | [default to 10] q | optional.String| Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=v)", "range(k=[minmax])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=v2,k3=[minmax] | sort | optional.String| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with "sort=field1,-field2" |

Return type

[]Task

Authorization

basic

HTTP request headers

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

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

ManualPreheat

ManualPreheat(ctx, projectName, preheatPolicyName, policy, optional) Manual preheat

Manual preheat

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
preheatPolicyName string Preheat Policy Name
policy PreheatPolicy The policy schema info
optional *PreheatApiManualPreheatOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiManualPreheatOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

(empty response body)

Authorization

basic

HTTP request headers

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

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

PingInstances

PingInstances(ctx, instance, optional) Ping status of a instance.

This endpoint checks status of a instance, the instance can be given by ID or Endpoint URL (together with credential)

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
instance Instance The JSON object of instance.
optional *PreheatApiPingInstancesOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiPingInstancesOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

(empty response body)

Authorization

basic

HTTP request headers

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

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

StopExecution

StopExecution(ctx, projectName, preheatPolicyName, executionId, execution, optional) Stop a execution

Stop a execution

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
preheatPolicyName string Preheat Policy Name
executionId int32 Execution ID
execution Execution The data of execution
optional *PreheatApiStopExecutionOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiStopExecutionOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

(empty response body)

Authorization

basic

HTTP request headers

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

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

UpdateInstance

UpdateInstance(ctx, preheatInstanceName, instance, optional) Update the specified P2P provider instance

Update the specified P2P provider instance

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
preheatInstanceName string Instance Name
instance Instance The instance to update
optional *PreheatApiUpdateInstanceOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiUpdateInstanceOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

(empty response body)

Authorization

basic

HTTP request headers

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

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

UpdatePolicy

UpdatePolicy(ctx, projectName, preheatPolicyName, policy, optional) Update preheat policy

Update preheat policy

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string The name of the project
preheatPolicyName string Preheat Policy Name
policy PreheatPolicy The policy schema info
optional *PreheatApiUpdatePolicyOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a PreheatApiUpdatePolicyOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request |

Return type

(empty response body)

Authorization

basic

HTTP request headers

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

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