Skip to content

Latest commit

 

History

History
491 lines (318 loc) · 22.5 KB

ProjectApi.md

File metadata and controls

491 lines (318 loc) · 22.5 KB

\ProjectApi

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

Method HTTP request Description
CreateProject Post /projects Create a new project.
DeleteProject Delete /projects/{project_name_or_id} Delete project by projectID
GetLogs Get /projects/{project_name}/logs Get recent logs of the projects
GetProject Get /projects/{project_name_or_id} Return specific project detail information
GetProjectDeletable Get /projects/{project_name_or_id}/_deletable Get the deletable status of the project
GetProjectSummary Get /projects/{project_name_or_id}/summary Get summary of the project.
GetScannerOfProject Get /projects/{project_name_or_id}/scanner Get project level scanner
HeadProject Head /projects Check if the project name user provided already exists.
ListProjects Get /projects List projects
ListScannerCandidatesOfProject Get /projects/{project_name_or_id}/scanner/candidates Get scanner registration candidates for configurating project level scanner
SetScannerOfProject Put /projects/{project_name_or_id}/scanner Configure scanner for the specified project
UpdateProject Put /projects/{project_name_or_id} Update properties for a selected project.

CreateProject

CreateProject(ctx, project, optional) Create a new project.

This endpoint is for user to create a new project.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
project ProjectReq New created project.
optional *ProjectApiCreateProjectOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a ProjectApiCreateProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xResourceNameInLocation | optional.Bool| The flag to indicate whether to return the name of the resource in Location. When X-Resource-Name-In-Location is true, the Location will return the name of the resource. | [default to false]

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]

DeleteProject

DeleteProject(ctx, projectNameOrId, optional) Delete project by projectID

This endpoint is aimed to delete project by project ID.

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a ProjectApiDeleteProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

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]

GetLogs

[]AuditLog GetLogs(ctx, projectName, optional) Get recent logs of the projects

Get recent logs of the projects

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 *ProjectApiGetLogsOpts optional parameters nil if no parameters

Optional Parameters

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

Return type

[]AuditLog

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]

GetProject

Project GetProject(ctx, projectNameOrId, optional) Return specific project detail information

This endpoint returns specific project information by project ID.

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a ProjectApiGetProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

Return type

Project

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]

GetProjectDeletable

ProjectDeletable GetProjectDeletable(ctx, projectNameOrId, optional) Get the deletable status of the project

Get the deletable status of the project

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a ProjectApiGetProjectDeletableOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

Return type

ProjectDeletable

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]

GetProjectSummary

ProjectSummary GetProjectSummary(ctx, projectNameOrId, optional) Get summary of the project.

Get summary of the project.

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a ProjectApiGetProjectSummaryOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

Return type

ProjectSummary

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]

GetScannerOfProject

ScannerRegistration GetScannerOfProject(ctx, projectNameOrId, optional) Get project level scanner

Get the scanner registration of the specified project. If no scanner registration is configured for the specified project, the system default scanner registration will be returned.

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a ProjectApiGetScannerOfProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

Return type

ScannerRegistration

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]

HeadProject

HeadProject(ctx, projectName, optional) Check if the project name user provided already exists.

This endpoint is used to check if the project name provided already exist.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectName string Project name for checking exists.
optional *ProjectApiHeadProjectOpts optional parameters nil if no parameters

Optional Parameters

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

ListProjects

[]Project ListProjects(ctx, optional) List projects

This endpoint returns projects created by Harbor.

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a ProjectApiListProjectsOpts 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]
page optional.Int64 The page number [default to 1]
pageSize optional.Int64 The size of per page [default to 10]
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"
name optional.String The name of project.
public optional.Bool The project is public or private.
owner optional.String The name of project owner.
withDetail optional.Bool Bool value indicating whether return detailed information of the project [default to true]

Return type

[]Project

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]

ListScannerCandidatesOfProject

[]ScannerRegistration ListScannerCandidatesOfProject(ctx, projectNameOrId, optional) Get scanner registration candidates for configurating project level scanner

Retrieve the system configured scanner registrations as candidates of setting project level scanner.

Required Parameters

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

Optional Parameters

Optional parameters are passed through a pointer to a ProjectApiListScannerCandidatesOfProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false] 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]

Return type

[]ScannerRegistration

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]

SetScannerOfProject

SetScannerOfProject(ctx, projectNameOrId, payload, optional) Configure scanner for the specified project

Set one of the system configured scanner registration as the indepndent scanner of the specified project.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectNameOrId string The name or id of the project
payload ProjectScanner
optional *ProjectApiSetScannerOfProjectOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a ProjectApiSetScannerOfProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

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]

UpdateProject

UpdateProject(ctx, projectNameOrId, project, optional) Update properties for a selected project.

This endpoint is aimed to update the properties of a project.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectNameOrId string The name or id of the project
project ProjectReq Updates of project.
optional *ProjectApiUpdateProjectOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a ProjectApiUpdateProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

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]