Skip to content

Latest commit

 

History

History
205 lines (131 loc) · 7.55 KB

LabelApi.md

File metadata and controls

205 lines (131 loc) · 7.55 KB

\LabelApi

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

Method HTTP request Description
CreateLabel Post /labels Post creates a label
DeleteLabel Delete /labels/{label_id} Delete the label specified by ID.
GetLabelByID Get /labels/{label_id} Get the label specified by ID.
ListLabels Get /labels List labels according to the query strings.
UpdateLabel Put /labels/{label_id} Update the label properties.

CreateLabel

CreateLabel(ctx, label, optional) Post creates a label

This endpoint let user creates a label.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
label Label The json object of label.
optional *LabelApiCreateLabelOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a LabelApiCreateLabelOpts 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]

DeleteLabel

DeleteLabel(ctx, labelId, optional) Delete the label specified by ID.

Delete the label specified by ID.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
labelId int64 Label ID
optional *LabelApiDeleteLabelOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a LabelApiDeleteLabelOpts 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]

GetLabelByID

Label GetLabelByID(ctx, labelId, optional) Get the label specified by ID.

This endpoint let user get the label by specific ID.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
labelId int64 Label ID
optional *LabelApiGetLabelByIDOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a LabelApiGetLabelByIDOpts struct

Name Type Description Notes

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

Return type

Label

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]

ListLabels

[]Label ListLabels(ctx, optional) List labels according to the query strings.

This endpoint let user list labels by name, scope and project_id

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a LabelApiListLabelsOpts struct

Name Type Description Notes
xRequestId optional.String An unique ID for the request
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"
page optional.Int64 The page number [default to 1]
pageSize optional.Int64 The size of per page [default to 10]
name optional.String The label name.
scope optional.String The label scope. Valid values are g and p. g for global labels and p for project labels.
projectId optional.Int64 Relevant project ID, required when scope is p.

Return type

[]Label

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]

UpdateLabel

UpdateLabel(ctx, labelId, label, optional) Update the label properties.

This endpoint let user update label properties.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
labelId int64 Label ID
label Label The updated label json object.
optional *LabelApiUpdateLabelOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a LabelApiUpdateLabelOpts 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]