Categorygithub.com/x1nchen/portainer
repositorypackage
1.23.8
Repository: https://github.com/x1nchen/portainer.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Go API client for swagger

Portainer API is an HTTP API served by Portainer. It is used by the Portainer UI and everything you can do with the UI can be done using the HTTP API. Examples are available at https://gist.github.com/deviantony/77026d402366b4b43fa5918d41bc42f8 You can find out more about Portainer at http://portainer.io and get some support on Slack. # Authentication Most of the API endpoints require to be authenticated as well as some level of authorization to be used. Portainer API uses JSON Web Token to manage authentication and thus requires you to provide a token in the Authorization header of each request with the Bearer authentication mechanism. Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcm5hbWUiOiJhZG1pbiIsInJvbGUiOjEsImV4cCI6MTQ5OTM3NjE1NH0.NJ6vE8FY1WG6jsRQzfMqeatJ4vh2TWAeeYfDhP71YEE # Security Each API endpoint has an associated access policy, it is documented in the description of each endpoint. Different access policies are available: * Public access * Authenticated access * Restricted access * Administrator access ### Public access No authentication is required to access the endpoints with this access policy. ### Authenticated access Authentication is required to access the endpoints with this access policy. ### Restricted access Authentication is required to access the endpoints with this access policy. Extra-checks might be added to ensure access to the resource is granted. Returned data might also be filtered. ### Administrator access Authentication as well as an administrator role are required to access the endpoints with this access policy. # Execute Docker requests Portainer DO NOT expose specific endpoints to manage your Docker resources (create a container, remove a volume, etc...). Instead, it acts as a reverse-proxy to the Docker HTTP API. This means that you can execute Docker requests via the Portainer HTTP API. To do so, you can use the /endpoints/{id}/docker Portainer API endpoint (which is not documented below due to Swagger limitations). This endpoint has a restricted access policy so you still need to be authenticated to be able to query this endpoint. Any query on this endpoint will be proxied to the Docker API of the associated endpoint (requests and responses objects are the same as documented in the Docker API). NOTE: You can find more information on how to query the Docker API in the Docker official documentation as well as in this Portainer example.

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 1.23.1
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

import "./swagger"

Documentation for API Endpoints

All URIs are relative to http://portainer.domain/api

ClassMethodHTTP requestDescription
AuthApiAuthenticateUserPost /authAuthenticate a user
DockerhubApiDockerHubInspectGet /dockerhubRetrieve DockerHub information
DockerhubApiDockerHubUpdatePut /dockerhubUpdate DockerHub information
EndpointGroupsApiEndpointGroupAddEndpointPut /endpoint_groups/{id}/endpoints/{endpointId}Add an endpoint to an endpoint group
EndpointGroupsApiEndpointGroupCreatePost /endpoint_groupsCreate a new endpoint
EndpointGroupsApiEndpointGroupDeleteDelete /endpoint_groups/{id}Remove an endpoint group
EndpointGroupsApiEndpointGroupDeleteEndpointDelete /endpoint_groups/{id}/endpoints/{endpointId}Remove an endpoint group
EndpointGroupsApiEndpointGroupInspectGet /endpoint_groups/{id}Inspect an endpoint group
EndpointGroupsApiEndpointGroupListGet /endpoint_groupsList endpoint groups
EndpointGroupsApiEndpointGroupUpdatePut /endpoint_groups/{id}Update an endpoint group
EndpointsApiEndpointCreatePost /endpointsCreate a new endpoint
EndpointsApiEndpointDeleteDelete /endpoints/{id}Remove an endpoint
EndpointsApiEndpointInspectGet /endpoints/{id}Inspect an endpoint
EndpointsApiEndpointJobPost /endpoints/{id}/jobExecute a job on the endpoint host
EndpointsApiEndpointListGet /endpointsList endpoints
EndpointsApiEndpointUpdatePut /endpoints/{id}Update an endpoint
ExtensionsApiExtensionCreatePost /extensionsEnable an extension
ExtensionsApiExtensionDeleteDelete /extensions/{id}Disable an extension
ExtensionsApiExtensionInspectGet /extensions/{id}Inspect an extension
ExtensionsApiExtensionListGet /extensionsList extensions
ExtensionsApiExtensionUpdatePut /extensions/{id}Update an extension
RegistriesApiRegistryCreatePost /registriesCreate a new registry
RegistriesApiRegistryDeleteDelete /registries/{id}Remove a registry
RegistriesApiRegistryInspectGet /registries/{id}Inspect a registry
RegistriesApiRegistryListGet /registriesList registries
RegistriesApiRegistryUpdatePut /registries/{id}Update a registry
ResourceControlsApiResourceControlCreatePost /resource_controlsCreate a new resource control
ResourceControlsApiResourceControlDeleteDelete /resource_controls/{id}Remove a resource control
ResourceControlsApiResourceControlUpdatePut /resource_controls/{id}Update a resource control
RolesApiRoleListGet /rolesList roles
SettingsApiPublicSettingsInspectGet /settings/publicRetrieve Portainer public settings
SettingsApiSettingsInspectGet /settingsRetrieve Portainer settings
SettingsApiSettingsLDAPCheckPut /settings/authentication/checkLDAPTest LDAP connectivity
SettingsApiSettingsUpdatePut /settingsUpdate Portainer settings
StacksApiStackCreatePost /stacksDeploy a new stack
StacksApiStackDeleteDelete /stacks/{id}Remove a stack
StacksApiStackFileInspectGet /stacks/{id}/fileRetrieve the content of the Stack file for the specified stack
StacksApiStackInspectGet /stacks/{id}Inspect a stack
StacksApiStackListGet /stacksList stacks
StacksApiStackMigratePost /stacks/{id}/migrateMigrate a stack to another endpoint
StacksApiStackUpdatePut /stacks/{id}Update a stack
StatusApiStatusInspectGet /statusCheck Portainer status
TagsApiTagCreatePost /tagsCreate a new tag
TagsApiTagDeleteDelete /tags/{id}Remove a tag
TagsApiTagListGet /tagsList tags
TeamMembershipsApiTeamMembershipCreatePost /team_membershipsCreate a new team membership
TeamMembershipsApiTeamMembershipDeleteDelete /team_memberships/{id}Remove a team membership
TeamMembershipsApiTeamMembershipListGet /team_membershipsList team memberships
TeamMembershipsApiTeamMembershipUpdatePut /team_memberships/{id}Update a team membership
TeamsApiTeamCreatePost /teamsCreate a new team
TeamsApiTeamDeleteDelete /teams/{id}Remove a team
TeamsApiTeamInspectGet /teams/{id}Inspect a team
TeamsApiTeamListGet /teamsList teams
TeamsApiTeamMembershipsInspectGet /teams/{id}/membershipsInspect a team memberships
TeamsApiTeamUpdatePut /teams/{id}Update a team
TemplatesApiTemplateCreatePost /templatesCreate a new template
TemplatesApiTemplateDeleteDelete /templates/{id}Remove a template
TemplatesApiTemplateInspectGet /templates/{id}Inspect a template
TemplatesApiTemplateListGet /templatesList available templates
TemplatesApiTemplateUpdatePut /templates/{id}Update a template
UploadApiUploadTLSPost /upload/tls/{certificate}Upload TLS files
UsersApiUserAdminCheckGet /users/admin/checkCheck administrator account existence
UsersApiUserAdminInitPost /users/admin/initInitialize administrator account
UsersApiUserCreatePost /usersCreate a new user
UsersApiUserDeleteDelete /users/{id}Remove a user
UsersApiUserInspectGet /users/{id}Inspect a user
UsersApiUserListGet /usersList users
UsersApiUserMembershipsInspectGet /users/{id}/membershipsInspect a user memberships
UsersApiUserPasswordCheckPost /users/{id}/passwdCheck password validity for a user
UsersApiUserUpdatePut /users/{id}Update a user

Documentation For Models

Documentation For Authorization

jwt

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

Author

[email protected]