THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

This is Gitea test Portainer repository mirror from Github
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1314 lines
57 KiB

  1. package portainer
  2. import "time"
  3. type (
  4. // Pair defines a key/value string pair
  5. Pair struct {
  6. Name string `json:"name"`
  7. Value string `json:"value"`
  8. }
  9. // CLIFlags represents the available flags on the CLI
  10. CLIFlags struct {
  11. Addr *string
  12. TunnelAddr *string
  13. TunnelPort *string
  14. AdminPassword *string
  15. AdminPasswordFile *string
  16. Assets *string
  17. Data *string
  18. EndpointURL *string
  19. ExternalEndpoints *string
  20. Labels *[]Pair
  21. Logo *string
  22. NoAuth *bool
  23. NoAnalytics *bool
  24. Templates *string
  25. TemplateFile *string
  26. TLS *bool
  27. TLSSkipVerify *bool
  28. TLSCacert *string
  29. TLSCert *string
  30. TLSKey *string
  31. SSL *bool
  32. SSLCert *string
  33. SSLKey *string
  34. SyncInterval *string
  35. Snapshot *bool
  36. SnapshotInterval *string
  37. }
  38. // Status represents the application status
  39. Status struct {
  40. Authentication bool `json:"Authentication"`
  41. EndpointManagement bool `json:"EndpointManagement"`
  42. Snapshot bool `json:"Snapshot"`
  43. Analytics bool `json:"Analytics"`
  44. Version string `json:"Version"`
  45. }
  46. // LDAPSettings represents the settings used to connect to a LDAP server
  47. LDAPSettings struct {
  48. ReaderDN string `json:"ReaderDN"`
  49. Password string `json:"Password,omitempty"`
  50. URL string `json:"URL"`
  51. TLSConfig TLSConfiguration `json:"TLSConfig"`
  52. StartTLS bool `json:"StartTLS"`
  53. SearchSettings []LDAPSearchSettings `json:"SearchSettings"`
  54. GroupSearchSettings []LDAPGroupSearchSettings `json:"GroupSearchSettings"`
  55. AutoCreateUsers bool `json:"AutoCreateUsers"`
  56. }
  57. // OAuthSettings represents the settings used to authorize with an authorization server
  58. OAuthSettings struct {
  59. ClientID string `json:"ClientID"`
  60. ClientSecret string `json:"ClientSecret,omitempty"`
  61. AccessTokenURI string `json:"AccessTokenURI"`
  62. AuthorizationURI string `json:"AuthorizationURI"`
  63. ResourceURI string `json:"ResourceURI"`
  64. RedirectURI string `json:"RedirectURI"`
  65. UserIdentifier string `json:"UserIdentifier"`
  66. Scopes string `json:"Scopes"`
  67. OAuthAutoCreateUsers bool `json:"OAuthAutoCreateUsers"`
  68. DefaultTeamID TeamID `json:"DefaultTeamID"`
  69. }
  70. // TLSConfiguration represents a TLS configuration
  71. TLSConfiguration struct {
  72. TLS bool `json:"TLS"`
  73. TLSSkipVerify bool `json:"TLSSkipVerify"`
  74. TLSCACertPath string `json:"TLSCACert,omitempty"`
  75. TLSCertPath string `json:"TLSCert,omitempty"`
  76. TLSKeyPath string `json:"TLSKey,omitempty"`
  77. }
  78. // LDAPSearchSettings represents settings used to search for users in a LDAP server
  79. LDAPSearchSettings struct {
  80. BaseDN string `json:"BaseDN"`
  81. Filter string `json:"Filter"`
  82. UserNameAttribute string `json:"UserNameAttribute"`
  83. }
  84. // LDAPGroupSearchSettings represents settings used to search for groups in a LDAP server
  85. LDAPGroupSearchSettings struct {
  86. GroupBaseDN string `json:"GroupBaseDN"`
  87. GroupFilter string `json:"GroupFilter"`
  88. GroupAttribute string `json:"GroupAttribute"`
  89. }
  90. // Settings represents the application settings
  91. Settings struct {
  92. LogoURL string `json:"LogoURL"`
  93. BlackListedLabels []Pair `json:"BlackListedLabels"`
  94. AuthenticationMethod AuthenticationMethod `json:"AuthenticationMethod"`
  95. LDAPSettings LDAPSettings `json:"LDAPSettings"`
  96. OAuthSettings OAuthSettings `json:"OAuthSettings"`
  97. AllowBindMountsForRegularUsers bool `json:"AllowBindMountsForRegularUsers"`
  98. AllowPrivilegedModeForRegularUsers bool `json:"AllowPrivilegedModeForRegularUsers"`
  99. AllowVolumeBrowserForRegularUsers bool `json:"AllowVolumeBrowserForRegularUsers"`
  100. SnapshotInterval string `json:"SnapshotInterval"`
  101. TemplatesURL string `json:"TemplatesURL"`
  102. EnableHostManagementFeatures bool `json:"EnableHostManagementFeatures"`
  103. EdgeAgentCheckinInterval int `json:"EdgeAgentCheckinInterval"`
  104. // Deprecated fields
  105. DisplayDonationHeader bool
  106. DisplayExternalContributors bool
  107. }
  108. // User represents a user account
  109. User struct {
  110. ID UserID `json:"Id"`
  111. Username string `json:"Username"`
  112. Password string `json:"Password,omitempty"`
  113. Role UserRole `json:"Role"`
  114. PortainerAuthorizations Authorizations `json:"PortainerAuthorizations"`
  115. EndpointAuthorizations EndpointAuthorizations `json:"EndpointAuthorizations"`
  116. }
  117. // UserID represents a user identifier
  118. UserID int
  119. // UserRole represents the role of a user. It can be either an administrator
  120. // or a regular user
  121. UserRole int
  122. // AuthenticationMethod represents the authentication method used to authenticate a user
  123. AuthenticationMethod int
  124. // Team represents a list of user accounts
  125. Team struct {
  126. ID TeamID `json:"Id"`
  127. Name string `json:"Name"`
  128. }
  129. // TeamID represents a team identifier
  130. TeamID int
  131. // TeamMembership represents a membership association between a user and a team
  132. TeamMembership struct {
  133. ID TeamMembershipID `json:"Id"`
  134. UserID UserID `json:"UserID"`
  135. TeamID TeamID `json:"TeamID"`
  136. Role MembershipRole `json:"Role"`
  137. }
  138. // TeamMembershipID represents a team membership identifier
  139. TeamMembershipID int
  140. // MembershipRole represents the role of a user within a team
  141. MembershipRole int
  142. // TokenData represents the data embedded in a JWT token
  143. TokenData struct {
  144. ID UserID
  145. Username string
  146. Role UserRole
  147. }
  148. // StackID represents a stack identifier (it must be composed of Name + "_" + SwarmID to create a unique identifier)
  149. StackID int
  150. // StackType represents the type of the stack (compose v2, stack deploy v3)
  151. StackType int
  152. // Stack represents a Docker stack created via docker stack deploy
  153. Stack struct {
  154. ID StackID `json:"Id"`
  155. Name string `json:"Name"`
  156. Type StackType `json:"Type"`
  157. EndpointID EndpointID `json:"EndpointId"`
  158. SwarmID string `json:"SwarmId"`
  159. EntryPoint string `json:"EntryPoint"`
  160. Env []Pair `json:"Env"`
  161. ResourceControl *ResourceControl `json:"ResourceControl"`
  162. ProjectPath string
  163. }
  164. // RegistryID represents a registry identifier
  165. RegistryID int
  166. // RegistryType represents a type of registry
  167. RegistryType int
  168. // GitlabRegistryData represents data required for gitlab registry to work
  169. GitlabRegistryData struct {
  170. ProjectID int `json:"ProjectId"`
  171. InstanceURL string `json:"InstanceURL"`
  172. }
  173. // Registry represents a Docker registry with all the info required
  174. // to connect to it
  175. Registry struct {
  176. ID RegistryID `json:"Id"`
  177. Type RegistryType `json:"Type"`
  178. Name string `json:"Name"`
  179. URL string `json:"URL"`
  180. Authentication bool `json:"Authentication"`
  181. Username string `json:"Username"`
  182. Password string `json:"Password,omitempty"`
  183. ManagementConfiguration *RegistryManagementConfiguration `json:"ManagementConfiguration"`
  184. Gitlab GitlabRegistryData `json:"Gitlab"`
  185. UserAccessPolicies UserAccessPolicies `json:"UserAccessPolicies"`
  186. TeamAccessPolicies TeamAccessPolicies `json:"TeamAccessPolicies"`
  187. // Deprecated fields
  188. // Deprecated in DBVersion == 18
  189. AuthorizedUsers []UserID `json:"AuthorizedUsers"`
  190. AuthorizedTeams []TeamID `json:"AuthorizedTeams"`
  191. }
  192. // RegistryManagementConfiguration represents a configuration that can be used to query
  193. // the registry API via the registry management extension.
  194. RegistryManagementConfiguration struct {
  195. Type RegistryType `json:"Type"`
  196. Authentication bool `json:"Authentication"`
  197. Username string `json:"Username"`
  198. Password string `json:"Password"`
  199. TLSConfig TLSConfiguration `json:"TLSConfig"`
  200. }
  201. // DockerHub represents all the required information to connect and use the
  202. // Docker Hub
  203. DockerHub struct {
  204. Authentication bool `json:"Authentication"`
  205. Username string `json:"Username"`
  206. Password string `json:"Password,omitempty"`
  207. }
  208. // EndpointID represents an endpoint identifier
  209. EndpointID int
  210. // EndpointType represents the type of an endpoint
  211. EndpointType int
  212. // EndpointStatus represents the status of an endpoint
  213. EndpointStatus int
  214. // Endpoint represents a Docker endpoint with all the info required
  215. // to connect to it
  216. Endpoint struct {
  217. ID EndpointID `json:"Id"`
  218. Name string `json:"Name"`
  219. Type EndpointType `json:"Type"`
  220. URL string `json:"URL"`
  221. GroupID EndpointGroupID `json:"GroupId"`
  222. PublicURL string `json:"PublicURL"`
  223. TLSConfig TLSConfiguration `json:"TLSConfig"`
  224. Extensions []EndpointExtension `json:"Extensions"`
  225. AzureCredentials AzureCredentials `json:"AzureCredentials,omitempty"`
  226. Tags []string `json:"Tags"`
  227. Status EndpointStatus `json:"Status"`
  228. Snapshots []Snapshot `json:"Snapshots"`
  229. UserAccessPolicies UserAccessPolicies `json:"UserAccessPolicies"`
  230. TeamAccessPolicies TeamAccessPolicies `json:"TeamAccessPolicies"`
  231. EdgeID string `json:"EdgeID,omitempty"`
  232. EdgeKey string `json:"EdgeKey"`
  233. // Deprecated fields
  234. // Deprecated in DBVersion == 4
  235. TLS bool `json:"TLS,omitempty"`
  236. TLSCACertPath string `json:"TLSCACert,omitempty"`
  237. TLSCertPath string `json:"TLSCert,omitempty"`
  238. TLSKeyPath string `json:"TLSKey,omitempty"`
  239. // Deprecated in DBVersion == 18
  240. AuthorizedUsers []UserID `json:"AuthorizedUsers"`
  241. AuthorizedTeams []TeamID `json:"AuthorizedTeams"`
  242. }
  243. // Authorization represents an authorization associated to an operation
  244. Authorization string
  245. // Authorizations represents a set of authorizations associated to a role
  246. Authorizations map[Authorization]bool
  247. // EndpointAuthorizations represents the authorizations associated to a set of endpoints
  248. EndpointAuthorizations map[EndpointID]Authorizations
  249. // APIOperationAuthorizationRequest represent an request for the authorization to execute an API operation
  250. APIOperationAuthorizationRequest struct {
  251. Path string
  252. Method string
  253. Authorizations Authorizations
  254. }
  255. // RoleID represents a role identifier
  256. RoleID int
  257. // Role represents a set of authorizations that can be associated to a user or
  258. // to a team.
  259. Role struct {
  260. ID RoleID `json:"Id"`
  261. Name string `json:"Name"`
  262. Description string `json:"Description"`
  263. Authorizations Authorizations `json:"Authorizations"`
  264. Priority int `json:"Priority"`
  265. }
  266. // AccessPolicy represent a policy that can be associated to a user or team
  267. AccessPolicy struct {
  268. RoleID RoleID `json:"RoleId"`
  269. }
  270. // UserAccessPolicies represent the association of an access policy and a user
  271. UserAccessPolicies map[UserID]AccessPolicy
  272. // TeamAccessPolicies represent the association of an access policy and a team
  273. TeamAccessPolicies map[TeamID]AccessPolicy
  274. // ScheduleID represents a schedule identifier.
  275. ScheduleID int
  276. // JobType represents a job type
  277. JobType int
  278. // ScriptExecutionJob represents a scheduled job that can execute a script via a privileged container
  279. ScriptExecutionJob struct {
  280. Endpoints []EndpointID
  281. Image string
  282. ScriptPath string
  283. RetryCount int
  284. RetryInterval int
  285. }
  286. // SnapshotJob represents a scheduled job that can create endpoint snapshots
  287. SnapshotJob struct{}
  288. // EndpointSyncJob represents a scheduled job that synchronize endpoints based on an external file
  289. EndpointSyncJob struct{}
  290. // Schedule represents a scheduled job.
  291. // It only contains a pointer to one of the JobRunner implementations
  292. // based on the JobType.
  293. // NOTE: The Recurring option is only used by ScriptExecutionJob at the moment
  294. Schedule struct {
  295. ID ScheduleID `json:"Id"`
  296. Name string
  297. CronExpression string
  298. Recurring bool
  299. Created int64
  300. JobType JobType
  301. EdgeSchedule *EdgeSchedule
  302. ScriptExecutionJob *ScriptExecutionJob
  303. SnapshotJob *SnapshotJob
  304. EndpointSyncJob *EndpointSyncJob
  305. }
  306. // EdgeSchedule represents a scheduled job that can run on Edge environments.
  307. EdgeSchedule struct {
  308. ID ScheduleID `json:"Id"`
  309. CronExpression string `json:"CronExpression"`
  310. Script string `json:"Script"`
  311. Version int `json:"Version"`
  312. Endpoints []EndpointID `json:"Endpoints"`
  313. }
  314. // WebhookID represents a webhook identifier.
  315. WebhookID int
  316. // WebhookType represents the type of resource a webhook is related to
  317. WebhookType int
  318. // Webhook represents a url webhook that can be used to update a service
  319. Webhook struct {
  320. ID WebhookID `json:"Id"`
  321. Token string `json:"Token"`
  322. ResourceID string `json:"ResourceId"`
  323. EndpointID EndpointID `json:"EndpointId"`
  324. WebhookType WebhookType `json:"Type"`
  325. }
  326. // AzureCredentials represents the credentials used to connect to an Azure
  327. // environment.
  328. AzureCredentials struct {
  329. ApplicationID string `json:"ApplicationID"`
  330. TenantID string `json:"TenantID"`
  331. AuthenticationKey string `json:"AuthenticationKey"`
  332. }
  333. // Snapshot represents a snapshot of a specific endpoint at a specific time
  334. Snapshot struct {
  335. Time int64 `json:"Time"`
  336. DockerVersion string `json:"DockerVersion"`
  337. Swarm bool `json:"Swarm"`
  338. TotalCPU int `json:"TotalCPU"`
  339. TotalMemory int64 `json:"TotalMemory"`
  340. RunningContainerCount int `json:"RunningContainerCount"`
  341. StoppedContainerCount int `json:"StoppedContainerCount"`
  342. VolumeCount int `json:"VolumeCount"`
  343. ImageCount int `json:"ImageCount"`
  344. ServiceCount int `json:"ServiceCount"`
  345. StackCount int `json:"StackCount"`
  346. SnapshotRaw SnapshotRaw `json:"SnapshotRaw"`
  347. }
  348. // SnapshotRaw represents all the information related to a snapshot as returned by the Docker API
  349. SnapshotRaw struct {
  350. Containers interface{} `json:"Containers"`
  351. Volumes interface{} `json:"Volumes"`
  352. Networks interface{} `json:"Networks"`
  353. Images interface{} `json:"Images"`
  354. Info interface{} `json:"Info"`
  355. Version interface{} `json:"Version"`
  356. }
  357. // EndpointGroupID represents an endpoint group identifier
  358. EndpointGroupID int
  359. // EndpointGroup represents a group of endpoints
  360. EndpointGroup struct {
  361. ID EndpointGroupID `json:"Id"`
  362. Name string `json:"Name"`
  363. Description string `json:"Description"`
  364. UserAccessPolicies UserAccessPolicies `json:"UserAccessPolicies"`
  365. TeamAccessPolicies TeamAccessPolicies `json:"TeamAccessPolicies"`
  366. Tags []string `json:"Tags"`
  367. // Deprecated fields
  368. Labels []Pair `json:"Labels"`
  369. // Deprecated in DBVersion == 18
  370. AuthorizedUsers []UserID `json:"AuthorizedUsers"`
  371. AuthorizedTeams []TeamID `json:"AuthorizedTeams"`
  372. }
  373. // EndpointExtension represents a deprecated form of Portainer extension
  374. // TODO: legacy extension management
  375. EndpointExtension struct {
  376. Type EndpointExtensionType `json:"Type"`
  377. URL string `json:"URL"`
  378. }
  379. // EndpointExtensionType represents the type of an endpoint extension. Only
  380. // one extension of each type can be associated to an endpoint
  381. EndpointExtensionType int
  382. // ResourceControlID represents a resource control identifier
  383. ResourceControlID int
  384. // ResourceControl represent a reference to a Docker resource with specific access controls
  385. ResourceControl struct {
  386. ID ResourceControlID `json:"Id"`
  387. ResourceID string `json:"ResourceId"`
  388. SubResourceIDs []string `json:"SubResourceIds"`
  389. Type ResourceControlType `json:"Type"`
  390. UserAccesses []UserResourceAccess `json:"UserAccesses"`
  391. TeamAccesses []TeamResourceAccess `json:"TeamAccesses"`
  392. Public bool `json:"Public"`
  393. AdministratorsOnly bool `json:"AdministratorsOnly"`
  394. System bool `json:"System"`
  395. // Deprecated fields
  396. // Deprecated in DBVersion == 2
  397. OwnerID UserID `json:"OwnerId,omitempty"`
  398. AccessLevel ResourceAccessLevel `json:"AccessLevel,omitempty"`
  399. }
  400. // ResourceControlType represents the type of resource associated to the resource control (volume, container, service...)
  401. ResourceControlType int
  402. // UserResourceAccess represents the level of control on a resource for a specific user
  403. UserResourceAccess struct {
  404. UserID UserID `json:"UserId"`
  405. AccessLevel ResourceAccessLevel `json:"AccessLevel"`
  406. }
  407. // TeamResourceAccess represents the level of control on a resource for a specific team
  408. TeamResourceAccess struct {
  409. TeamID TeamID `json:"TeamId"`
  410. AccessLevel ResourceAccessLevel `json:"AccessLevel"`
  411. }
  412. // TagID represents a tag identifier
  413. TagID int
  414. // Tag represents a tag that can be associated to a resource
  415. Tag struct {
  416. ID TagID
  417. Name string `json:"Name"`
  418. }
  419. // TemplateID represents a template identifier
  420. TemplateID int
  421. // TemplateType represents the type of a template
  422. TemplateType int
  423. // Template represents an application template
  424. Template struct {
  425. // Mandatory container/stack fields
  426. ID TemplateID `json:"Id"`
  427. Type TemplateType `json:"type"`
  428. Title string `json:"title"`
  429. Description string `json:"description"`
  430. AdministratorOnly bool `json:"administrator_only"`
  431. // Mandatory container fields
  432. Image string `json:"image"`
  433. // Mandatory stack fields
  434. Repository TemplateRepository `json:"repository"`
  435. // Optional stack/container fields
  436. Name string `json:"name,omitempty"`
  437. Logo string `json:"logo,omitempty"`
  438. Env []TemplateEnv `json:"env,omitempty"`
  439. Note string `json:"note,omitempty"`
  440. Platform string `json:"platform,omitempty"`
  441. Categories []string `json:"categories,omitempty"`
  442. // Optional container fields
  443. Registry string `json:"registry,omitempty"`
  444. Command string `json:"command,omitempty"`
  445. Network string `json:"network,omitempty"`
  446. Volumes []TemplateVolume `json:"volumes,omitempty"`
  447. Ports []string `json:"ports,omitempty"`
  448. Labels []Pair `json:"labels,omitempty"`
  449. Privileged bool `json:"privileged,omitempty"`
  450. Interactive bool `json:"interactive,omitempty"`
  451. RestartPolicy string `json:"restart_policy,omitempty"`
  452. Hostname string `json:"hostname,omitempty"`
  453. }
  454. // TemplateEnv represents a template environment variable configuration
  455. TemplateEnv struct {
  456. Name string `json:"name"`
  457. Label string `json:"label,omitempty"`
  458. Description string `json:"description,omitempty"`
  459. Default string `json:"default,omitempty"`
  460. Preset bool `json:"preset,omitempty"`
  461. Select []TemplateEnvSelect `json:"select,omitempty"`
  462. }
  463. // TemplateVolume represents a template volume configuration
  464. TemplateVolume struct {
  465. Container string `json:"container"`
  466. Bind string `json:"bind,omitempty"`
  467. ReadOnly bool `json:"readonly,omitempty"`
  468. }
  469. // TemplateRepository represents the git repository configuration for a template
  470. TemplateRepository struct {
  471. URL string `json:"url"`
  472. StackFile string `json:"stackfile"`
  473. }
  474. // TemplateEnvSelect represents text/value pair that will be displayed as a choice for the
  475. // template user
  476. TemplateEnvSelect struct {
  477. Text string `json:"text"`
  478. Value string `json:"value"`
  479. Default bool `json:"default"`
  480. }
  481. // ResourceAccessLevel represents the level of control associated to a resource
  482. ResourceAccessLevel int
  483. // TLSFileType represents a type of TLS file required to connect to a Docker endpoint.
  484. // It can be either a TLS CA file, a TLS certificate file or a TLS key file
  485. TLSFileType int
  486. // ExtensionID represents a extension identifier
  487. ExtensionID int
  488. // Extension represents a Portainer extension
  489. Extension struct {
  490. ID ExtensionID `json:"Id"`
  491. Enabled bool `json:"Enabled"`
  492. Name string `json:"Name,omitempty"`
  493. ShortDescription string `json:"ShortDescription,omitempty"`
  494. Description string `json:"Description,omitempty"`
  495. DescriptionURL string `json:"DescriptionURL,omitempty"`
  496. Price string `json:"Price,omitempty"`
  497. PriceDescription string `json:"PriceDescription,omitempty"`
  498. Deal bool `json:"Deal,omitempty"`
  499. Available bool `json:"Available,omitempty"`
  500. License LicenseInformation `json:"License,omitempty"`
  501. Version string `json:"Version"`
  502. UpdateAvailable bool `json:"UpdateAvailable"`
  503. ShopURL string `json:"ShopURL,omitempty"`
  504. Images []string `json:"Images,omitempty"`
  505. Logo string `json:"Logo,omitempty"`
  506. }
  507. // LicenseInformation represents information about an extension license
  508. LicenseInformation struct {
  509. LicenseKey string `json:"LicenseKey,omitempty"`
  510. Company string `json:"Company,omitempty"`
  511. Expiration string `json:"Expiration,omitempty"`
  512. Valid bool `json:"Valid,omitempty"`
  513. }
  514. // TunnelDetails represents information associated to a tunnel
  515. TunnelDetails struct {
  516. Status string
  517. LastActivity time.Time
  518. Port int
  519. Schedules []EdgeSchedule
  520. Credentials string
  521. }
  522. // TunnelServerInfo represents information associated to the tunnel server
  523. TunnelServerInfo struct {
  524. PrivateKeySeed string `json:"PrivateKeySeed"`
  525. }
  526. // CLIService represents a service for managing CLI
  527. CLIService interface {
  528. ParseFlags(version string) (*CLIFlags, error)
  529. ValidateFlags(flags *CLIFlags) error
  530. }
  531. // DataStore defines the interface to manage the data
  532. DataStore interface {
  533. Open() error
  534. Init() error
  535. Close() error
  536. MigrateData() error
  537. }
  538. // Server defines the interface to serve the API
  539. Server interface {
  540. Start() error
  541. }
  542. // UserService represents a service for managing user data
  543. UserService interface {
  544. User(ID UserID) (*User, error)
  545. UserByUsername(username string) (*User, error)
  546. Users() ([]User, error)
  547. UsersByRole(role UserRole) ([]User, error)
  548. CreateUser(user *User) error
  549. UpdateUser(ID UserID, user *User) error
  550. DeleteUser(ID UserID) error
  551. }
  552. RoleService interface {
  553. Role(ID RoleID) (*Role, error)
  554. Roles() ([]Role, error)
  555. CreateRole(role *Role) error
  556. UpdateRole(ID RoleID, role *Role) error
  557. }
  558. // TeamService represents a service for managing user data
  559. TeamService interface {
  560. Team(ID TeamID) (*Team, error)
  561. TeamByName(name string) (*Team, error)
  562. Teams() ([]Team, error)
  563. CreateTeam(team *Team) error
  564. UpdateTeam(ID TeamID, team *Team) error
  565. DeleteTeam(ID TeamID) error
  566. }
  567. // TeamMembershipService represents a service for managing team membership data
  568. TeamMembershipService interface {
  569. TeamMembership(ID TeamMembershipID) (*TeamMembership, error)
  570. TeamMemberships() ([]TeamMembership, error)
  571. TeamMembershipsByUserID(userID UserID) ([]TeamMembership, error)
  572. TeamMembershipsByTeamID(teamID TeamID) ([]TeamMembership, error)
  573. CreateTeamMembership(membership *TeamMembership) error
  574. UpdateTeamMembership(ID TeamMembershipID, membership *TeamMembership) error
  575. DeleteTeamMembership(ID TeamMembershipID) error
  576. DeleteTeamMembershipByUserID(userID UserID) error
  577. DeleteTeamMembershipByTeamID(teamID TeamID) error
  578. }
  579. // EndpointService represents a service for managing endpoint data
  580. EndpointService interface {
  581. Endpoint(ID EndpointID) (*Endpoint, error)
  582. Endpoints() ([]Endpoint, error)
  583. CreateEndpoint(endpoint *Endpoint) error
  584. UpdateEndpoint(ID EndpointID, endpoint *Endpoint) error
  585. DeleteEndpoint(ID EndpointID) error
  586. Synchronize(toCreate, toUpdate, toDelete []*Endpoint) error
  587. GetNextIdentifier() int
  588. }
  589. // EndpointGroupService represents a service for managing endpoint group data
  590. EndpointGroupService interface {
  591. EndpointGroup(ID EndpointGroupID) (*EndpointGroup, error)
  592. EndpointGroups() ([]EndpointGroup, error)
  593. CreateEndpointGroup(group *EndpointGroup) error
  594. UpdateEndpointGroup(ID EndpointGroupID, group *EndpointGroup) error
  595. DeleteEndpointGroup(ID EndpointGroupID) error
  596. }
  597. // RegistryService represents a service for managing registry data
  598. RegistryService interface {
  599. Registry(ID RegistryID) (*Registry, error)
  600. Registries() ([]Registry, error)
  601. CreateRegistry(registry *Registry) error
  602. UpdateRegistry(ID RegistryID, registry *Registry) error
  603. DeleteRegistry(ID RegistryID) error
  604. }
  605. // StackService represents a service for managing stack data
  606. StackService interface {
  607. Stack(ID StackID) (*Stack, error)
  608. StackByName(name string) (*Stack, error)
  609. Stacks() ([]Stack, error)
  610. CreateStack(stack *Stack) error
  611. UpdateStack(ID StackID, stack *Stack) error
  612. DeleteStack(ID StackID) error
  613. GetNextIdentifier() int
  614. }
  615. // DockerHubService represents a service for managing the DockerHub object
  616. DockerHubService interface {
  617. DockerHub() (*DockerHub, error)
  618. UpdateDockerHub(registry *DockerHub) error
  619. }
  620. // SettingsService represents a service for managing application settings
  621. SettingsService interface {
  622. Settings() (*Settings, error)
  623. UpdateSettings(settings *Settings) error
  624. }
  625. // VersionService represents a service for managing version data
  626. VersionService interface {
  627. DBVersion() (int, error)
  628. StoreDBVersion(version int) error
  629. }
  630. // TunnelServerService represents a service for managing data associated to the tunnel server
  631. TunnelServerService interface {
  632. Info() (*TunnelServerInfo, error)
  633. UpdateInfo(info *TunnelServerInfo) error
  634. }
  635. // WebhookService represents a service for managing webhook data.
  636. WebhookService interface {
  637. Webhooks() ([]Webhook, error)
  638. Webhook(ID WebhookID) (*Webhook, error)
  639. CreateWebhook(portainer *Webhook) error
  640. WebhookByResourceID(resourceID string) (*Webhook, error)
  641. WebhookByToken(token string) (*Webhook, error)
  642. DeleteWebhook(serviceID WebhookID) error
  643. }
  644. // ResourceControlService represents a service for managing resource control data
  645. ResourceControlService interface {
  646. ResourceControl(ID ResourceControlID) (*ResourceControl, error)
  647. ResourceControlByResourceIDAndType(resourceID string, resourceType ResourceControlType) (*ResourceControl, error)
  648. ResourceControls() ([]ResourceControl, error)
  649. CreateResourceControl(rc *ResourceControl) error
  650. UpdateResourceControl(ID ResourceControlID, resourceControl *ResourceControl) error
  651. DeleteResourceControl(ID ResourceControlID) error
  652. }
  653. // ScheduleService represents a service for managing schedule data
  654. ScheduleService interface {
  655. Schedule(ID ScheduleID) (*Schedule, error)
  656. Schedules() ([]Schedule, error)
  657. SchedulesByJobType(jobType JobType) ([]Schedule, error)
  658. CreateSchedule(schedule *Schedule) error
  659. UpdateSchedule(ID ScheduleID, schedule *Schedule) error
  660. DeleteSchedule(ID ScheduleID) error
  661. GetNextIdentifier() int
  662. }
  663. // TagService represents a service for managing tag data
  664. TagService interface {
  665. Tags() ([]Tag, error)
  666. CreateTag(tag *Tag) error
  667. DeleteTag(ID TagID) error
  668. }
  669. // TemplateService represents a service for managing template data
  670. TemplateService interface {
  671. Templates() ([]Template, error)
  672. Template(ID TemplateID) (*Template, error)
  673. CreateTemplate(template *Template) error
  674. UpdateTemplate(ID TemplateID, template *Template) error
  675. DeleteTemplate(ID TemplateID) error
  676. }
  677. // ExtensionService represents a service for managing extension data
  678. ExtensionService interface {
  679. Extension(ID ExtensionID) (*Extension, error)
  680. Extensions() ([]Extension, error)
  681. Persist(extension *Extension) error
  682. DeleteExtension(ID ExtensionID) error
  683. }
  684. // CryptoService represents a service for encrypting/hashing data
  685. CryptoService interface {
  686. Hash(data string) (string, error)
  687. CompareHashAndData(hash string, data string) error
  688. }
  689. // DigitalSignatureService represents a service to manage digital signatures
  690. DigitalSignatureService interface {
  691. ParseKeyPair(private, public []byte) error
  692. GenerateKeyPair() ([]byte, []byte, error)
  693. EncodedPublicKey() string
  694. PEMHeaders() (string, string)
  695. CreateSignature(message string) (string, error)
  696. }
  697. // JWTService represents a service for managing JWT tokens
  698. JWTService interface {
  699. GenerateToken(data *TokenData) (string, error)
  700. ParseAndVerifyToken(token string) (*TokenData, error)
  701. }
  702. // FileService represents a service for managing files
  703. FileService interface {
  704. GetFileContent(filePath string) ([]byte, error)
  705. Rename(oldPath, newPath string) error
  706. RemoveDirectory(directoryPath string) error
  707. StoreTLSFileFromBytes(folder string, fileType TLSFileType, data []byte) (string, error)
  708. GetPathForTLSFile(folder string, fileType TLSFileType) (string, error)
  709. DeleteTLSFile(folder string, fileType TLSFileType) error
  710. DeleteTLSFiles(folder string) error
  711. GetStackProjectPath(stackIdentifier string) string
  712. StoreStackFileFromBytes(stackIdentifier, fileName string, data []byte) (string, error)
  713. StoreRegistryManagementFileFromBytes(folder, fileName string, data []byte) (string, error)
  714. KeyPairFilesExist() (bool, error)
  715. StoreKeyPair(private, public []byte, privatePEMHeader, publicPEMHeader string) error
  716. LoadKeyPair() ([]byte, []byte, error)
  717. WriteJSONToFile(path string, content interface{}) error
  718. FileExists(path string) (bool, error)
  719. StoreScheduledJobFileFromBytes(identifier string, data []byte) (string, error)
  720. GetScheduleFolder(identifier string) string
  721. ExtractExtensionArchive(data []byte) error
  722. GetBinaryFolder() string
  723. }
  724. // GitService represents a service for managing Git
  725. GitService interface {
  726. ClonePublicRepository(repositoryURL, referenceName string, destination string) error
  727. ClonePrivateRepositoryWithBasicAuth(repositoryURL, referenceName string, destination, username, password string) error
  728. }
  729. // JobScheduler represents a service to run jobs on a periodic basis
  730. JobScheduler interface {
  731. ScheduleJob(runner JobRunner) error
  732. UpdateJobSchedule(runner JobRunner) error
  733. UpdateSystemJobSchedule(jobType JobType, newCronExpression string) error
  734. UnscheduleJob(ID ScheduleID)
  735. Start()
  736. }
  737. // JobRunner represents a service that can be used to run a job
  738. JobRunner interface {
  739. Run()
  740. GetSchedule() *Schedule
  741. }
  742. // Snapshotter represents a service used to create endpoint snapshots
  743. Snapshotter interface {
  744. CreateSnapshot(endpoint *Endpoint) (*Snapshot, error)
  745. }
  746. // LDAPService represents a service used to authenticate users against a LDAP/AD
  747. LDAPService interface {
  748. AuthenticateUser(username, password string, settings *LDAPSettings) error
  749. TestConnectivity(settings *LDAPSettings) error
  750. GetUserGroups(username string, settings *LDAPSettings) ([]string, error)
  751. }
  752. // SwarmStackManager represents a service to manage Swarm stacks
  753. SwarmStackManager interface {
  754. Login(dockerhub *DockerHub, registries []Registry, endpoint *Endpoint)
  755. Logout(endpoint *Endpoint) error
  756. Deploy(stack *Stack, prune bool, endpoint *Endpoint) error
  757. Remove(stack *Stack, endpoint *Endpoint) error
  758. }
  759. // ComposeStackManager represents a service to manage Compose stacks
  760. ComposeStackManager interface {
  761. Up(stack *Stack, endpoint *Endpoint) error
  762. Down(stack *Stack, endpoint *Endpoint) error
  763. }
  764. // JobService represents a service to manage job execution on hosts
  765. JobService interface {
  766. ExecuteScript(endpoint *Endpoint, nodeName, image string, script []byte, schedule *Schedule) error
  767. }
  768. // ExtensionManager represents a service used to manage extensions
  769. ExtensionManager interface {
  770. FetchExtensionDefinitions() ([]Extension, error)
  771. InstallExtension(extension *Extension, licenseKey string, archiveFileName string, extensionArchive []byte) error
  772. EnableExtension(extension *Extension, licenseKey string) error
  773. DisableExtension(extension *Extension) error
  774. UpdateExtension(extension *Extension, version string) error
  775. StartExtensions() error
  776. }
  777. // ReverseTunnelService represensts a service used to manage reverse tunnel connections.
  778. ReverseTunnelService interface {
  779. StartTunnelServer(addr, port string, snapshotter Snapshotter) error
  780. GenerateEdgeKey(url, host string, endpointIdentifier int) string
  781. SetTunnelStatusToActive(endpointID EndpointID)
  782. SetTunnelStatusToRequired(endpointID EndpointID) error
  783. SetTunnelStatusToIdle(endpointID EndpointID)
  784. GetTunnelDetails(endpointID EndpointID) *TunnelDetails
  785. AddSchedule(endpointID EndpointID, schedule *EdgeSchedule)
  786. RemoveSchedule(scheduleID ScheduleID)
  787. }
  788. )
  789. const (
  790. // APIVersion is the version number of the Portainer API
  791. APIVersion = "1.23.0-dev"
  792. // DBVersion is the version number of the Portainer database
  793. DBVersion = 22
  794. // AssetsServerURL represents the URL of the Portainer asset server
  795. AssetsServerURL = "https://portainer-io-assets.sfo2.digitaloceanspaces.com"
  796. // MessageOfTheDayURL represents the URL where Portainer MOTD message can be retrieved
  797. MessageOfTheDayURL = AssetsServerURL + "/motd.json"
  798. // VersionCheckURL represents the URL used to retrieve the latest version of Portainer
  799. VersionCheckURL = "https://api.github.com/repos/portainer/portainer/releases/latest"
  800. // ExtensionDefinitionsURL represents the URL where Portainer extension definitions can be retrieved
  801. ExtensionDefinitionsURL = AssetsServerURL + "/extensions-" + APIVersion + ".json"
  802. // SupportProductsURL represents the URL where Portainer support products can be retrieved
  803. SupportProductsURL = AssetsServerURL + "/support.json"
  804. // PortainerAgentHeader represents the name of the header available in any agent response
  805. PortainerAgentHeader = "Portainer-Agent"
  806. // PortainerAgentEdgeIDHeader represent the name of the header containing the Edge ID associated to an agent/agent cluster
  807. PortainerAgentEdgeIDHeader = "X-PortainerAgent-EdgeID"
  808. // PortainerAgentTargetHeader represent the name of the header containing the target node name
  809. PortainerAgentTargetHeader = "X-PortainerAgent-Target"
  810. // PortainerAgentSignatureHeader represent the name of the header containing the digital signature
  811. PortainerAgentSignatureHeader = "X-PortainerAgent-Signature"
  812. // PortainerAgentPublicKeyHeader represent the name of the header containing the public key
  813. PortainerAgentPublicKeyHeader = "X-PortainerAgent-PublicKey"
  814. // PortainerAgentSignatureMessage represents the message used to create a digital signature
  815. // to be used when communicating with an agent
  816. PortainerAgentSignatureMessage = "Portainer-App"
  817. // ExtensionServer represents the server used by Portainer to communicate with extensions
  818. ExtensionServer = "localhost"
  819. // DefaultEdgeAgentCheckinIntervalInSeconds represents the default interval (in seconds) used by Edge agents to checkin with the Portainer instance
  820. DefaultEdgeAgentCheckinIntervalInSeconds = 5
  821. // LocalExtensionManifestFile represents the name of the local manifest file for extensions
  822. LocalExtensionManifestFile = "/app/extensions.json"
  823. )
  824. const (
  825. // TLSFileCA represents a TLS CA certificate file
  826. TLSFileCA TLSFileType = iota
  827. // TLSFileCert represents a TLS certificate file
  828. TLSFileCert
  829. // TLSFileKey represents a TLS key file
  830. TLSFileKey
  831. )
  832. const (
  833. _ MembershipRole = iota
  834. // TeamLeader represents a leader role inside a team
  835. TeamLeader
  836. // TeamMember represents a member role inside a team
  837. TeamMember
  838. )
  839. const (
  840. _ UserRole = iota
  841. // AdministratorRole represents an administrator user role
  842. AdministratorRole
  843. // StandardUserRole represents a regular user role
  844. StandardUserRole
  845. )
  846. const (
  847. _ AuthenticationMethod = iota
  848. // AuthenticationInternal represents the internal authentication method (authentication against Portainer API)
  849. AuthenticationInternal
  850. // AuthenticationLDAP represents the LDAP authentication method (authentication against a LDAP server)
  851. AuthenticationLDAP
  852. //AuthenticationOAuth represents the OAuth authentication method (authentication against a authorization server)
  853. AuthenticationOAuth
  854. )
  855. const (
  856. _ ResourceAccessLevel = iota
  857. // ReadWriteAccessLevel represents an access level with read-write permissions on a resource
  858. ReadWriteAccessLevel
  859. )
  860. const (
  861. _ ResourceControlType = iota
  862. // ContainerResourceControl represents a resource control associated to a Docker container
  863. ContainerResourceControl
  864. // ServiceResourceControl represents a resource control associated to a Docker service
  865. ServiceResourceControl
  866. // VolumeResourceControl represents a resource control associated to a Docker volume
  867. VolumeResourceControl
  868. // NetworkResourceControl represents a resource control associated to a Docker network
  869. NetworkResourceControl
  870. // SecretResourceControl represents a resource control associated to a Docker secret
  871. SecretResourceControl
  872. // StackResourceControl represents a resource control associated to a stack composed of Docker services
  873. StackResourceControl
  874. // ConfigResourceControl represents a resource control associated to a Docker config
  875. ConfigResourceControl
  876. )
  877. const (
  878. _ EndpointExtensionType = iota
  879. // StoridgeEndpointExtension represents the Storidge extension
  880. StoridgeEndpointExtension
  881. )
  882. const (
  883. _ EndpointType = iota
  884. // DockerEnvironment represents an endpoint connected to a Docker environment
  885. DockerEnvironment
  886. // AgentOnDockerEnvironment represents an endpoint connected to a Portainer agent deployed on a Docker environment
  887. AgentOnDockerEnvironment
  888. // AzureEnvironment represents an endpoint connected to an Azure environment
  889. AzureEnvironment
  890. // EdgeAgentEnvironment represents an endpoint connected to an Edge agent
  891. EdgeAgentEnvironment
  892. )
  893. const (
  894. _ StackType = iota
  895. // DockerSwarmStack represents a stack managed via docker stack
  896. DockerSwarmStack
  897. // DockerComposeStack represents a stack managed via docker-compose
  898. DockerComposeStack
  899. )
  900. const (
  901. _ TemplateType = iota
  902. // ContainerTemplate represents a container template
  903. ContainerTemplate
  904. // SwarmStackTemplate represents a template used to deploy a Swarm stack
  905. SwarmStackTemplate
  906. // ComposeStackTemplate represents a template used to deploy a Compose stack
  907. ComposeStackTemplate
  908. )
  909. const (
  910. _ EndpointStatus = iota
  911. // EndpointStatusUp is used to represent an available endpoint
  912. EndpointStatusUp
  913. // EndpointStatusDown is used to represent an unavailable endpoint
  914. EndpointStatusDown
  915. )
  916. const (
  917. _ WebhookType = iota
  918. // ServiceWebhook is a webhook for restarting a docker service
  919. ServiceWebhook
  920. )
  921. const (
  922. _ ExtensionID = iota
  923. // RegistryManagementExtension represents the registry management extension
  924. RegistryManagementExtension
  925. // OAuthAuthenticationExtension represents the OAuth authentication extension
  926. OAuthAuthenticationExtension
  927. // RBACExtension represents the RBAC extension
  928. RBACExtension
  929. )
  930. const (
  931. _ JobType = iota
  932. // ScriptExecutionJobType is a non-system job used to execute a script against a list of
  933. // endpoints via privileged containers
  934. ScriptExecutionJobType
  935. // SnapshotJobType is a system job used to create endpoint snapshots
  936. SnapshotJobType
  937. // EndpointSyncJobType is a system job used to synchronize endpoints from
  938. // an external definition store
  939. EndpointSyncJobType
  940. )
  941. const (
  942. _ RegistryType = iota
  943. // QuayRegistry represents a Quay.io registry
  944. QuayRegistry
  945. // AzureRegistry represents an ACR registry
  946. AzureRegistry
  947. // CustomRegistry represents a custom registry
  948. CustomRegistry
  949. // GitlabRegistry represents a gitlab registry
  950. GitlabRegistry
  951. )
  952. const (
  953. // EdgeAgentIdle represents an idle state for a tunnel connected to an Edge endpoint.
  954. EdgeAgentIdle string = "IDLE"
  955. // EdgeAgentManagementRequired represents a required state for a tunnel connected to an Edge endpoint
  956. EdgeAgentManagementRequired string = "REQUIRED"
  957. // EdgeAgentActive represents an active state for a tunnel connected to an Edge endpoint
  958. EdgeAgentActive string = "ACTIVE"
  959. )
  960. const (
  961. OperationDockerContainerArchiveInfo Authorization = "DockerContainerArchiveInfo"
  962. OperationDockerContainerList Authorization = "DockerContainerList"
  963. OperationDockerContainerExport Authorization = "DockerContainerExport"
  964. OperationDockerContainerChanges Authorization = "DockerContainerChanges"
  965. OperationDockerContainerInspect Authorization = "DockerContainerInspect"
  966. OperationDockerContainerTop Authorization = "DockerContainerTop"
  967. OperationDockerContainerLogs Authorization = "DockerContainerLogs"
  968. OperationDockerContainerStats Authorization = "DockerContainerStats"
  969. OperationDockerContainerAttachWebsocket Authorization = "DockerContainerAttachWebsocket"
  970. OperationDockerContainerArchive Authorization = "DockerContainerArchive"
  971. OperationDockerContainerCreate Authorization = "DockerContainerCreate"
  972. OperationDockerContainerPrune Authorization = "DockerContainerPrune"
  973. OperationDockerContainerKill Authorization = "DockerContainerKill"
  974. OperationDockerContainerPause Authorization = "DockerContainerPause"
  975. OperationDockerContainerUnpause Authorization = "DockerContainerUnpause"
  976. OperationDockerContainerRestart Authorization = "DockerContainerRestart"
  977. OperationDockerContainerStart Authorization = "DockerContainerStart"
  978. OperationDockerContainerStop Authorization = "DockerContainerStop"
  979. OperationDockerContainerWait Authorization = "DockerContainerWait"
  980. OperationDockerContainerResize Authorization = "DockerContainerResize"
  981. OperationDockerContainerAttach Authorization = "DockerContainerAttach"
  982. OperationDockerContainerExec Authorization = "DockerContainerExec"
  983. OperationDockerContainerRename Authorization = "DockerContainerRename"
  984. OperationDockerContainerUpdate Authorization = "DockerContainerUpdate"
  985. OperationDockerContainerPutContainerArchive Authorization = "DockerContainerPutContainerArchive"
  986. OperationDockerContainerDelete Authorization = "DockerContainerDelete"
  987. OperationDockerImageList Authorization = "DockerImageList"
  988. OperationDockerImageSearch Authorization = "DockerImageSearch"
  989. OperationDockerImageGetAll Authorization = "DockerImageGetAll"
  990. OperationDockerImageGet Authorization = "DockerImageGet"
  991. OperationDockerImageHistory Authorization = "DockerImageHistory"
  992. OperationDockerImageInspect Authorization = "DockerImageInspect"
  993. OperationDockerImageLoad Authorization = "DockerImageLoad"
  994. OperationDockerImageCreate Authorization = "DockerImageCreate"
  995. OperationDockerImagePrune Authorization = "DockerImagePrune"
  996. OperationDockerImagePush Authorization = "DockerImagePush"
  997. OperationDockerImageTag Authorization = "DockerImageTag"
  998. OperationDockerImageDelete Authorization = "DockerImageDelete"
  999. OperationDockerImageCommit Authorization = "DockerImageCommit"
  1000. OperationDockerImageBuild Authorization = "DockerImageBuild"
  1001. OperationDockerNetworkList Authorization = "DockerNetworkList"
  1002. OperationDockerNetworkInspect Authorization = "DockerNetworkInspect"
  1003. OperationDockerNetworkCreate Authorization = "DockerNetworkCreate"
  1004. OperationDockerNetworkConnect Authorization = "DockerNetworkConnect"
  1005. OperationDockerNetworkDisconnect Authorization = "DockerNetworkDisconnect"
  1006. OperationDockerNetworkPrune Authorization = "DockerNetworkPrune"
  1007. OperationDockerNetworkDelete Authorization = "DockerNetworkDelete"
  1008. OperationDockerVolumeList Authorization = "DockerVolumeList"
  1009. OperationDockerVolumeInspect Authorization = "DockerVolumeInspect"
  1010. OperationDockerVolumeCreate Authorization = "DockerVolumeCreate"
  1011. OperationDockerVolumePrune Authorization = "DockerVolumePrune"
  1012. OperationDockerVolumeDelete Authorization = "DockerVolumeDelete"
  1013. OperationDockerExecInspect Authorization = "DockerExecInspect"
  1014. OperationDockerExecStart Authorization = "DockerExecStart"
  1015. OperationDockerExecResize Authorization = "DockerExecResize"
  1016. OperationDockerSwarmInspect Authorization = "DockerSwarmInspect"
  1017. OperationDockerSwarmUnlockKey Authorization = "DockerSwarmUnlockKey"
  1018. OperationDockerSwarmInit Authorization = "DockerSwarmInit"
  1019. OperationDockerSwarmJoin Authorization = "DockerSwarmJoin"
  1020. OperationDockerSwarmLeave Authorization = "DockerSwarmLeave"
  1021. OperationDockerSwarmUpdate Authorization = "DockerSwarmUpdate"
  1022. OperationDockerSwarmUnlock Authorization = "DockerSwarmUnlock"
  1023. OperationDockerNodeList Authorization = "DockerNodeList"
  1024. OperationDockerNodeInspect Authorization = "DockerNodeInspect"
  1025. OperationDockerNodeUpdate Authorization = "DockerNodeUpdate"
  1026. OperationDockerNodeDelete Authorization = "DockerNodeDelete"
  1027. OperationDockerServiceList Authorization = "DockerServiceList"
  1028. OperationDockerServiceInspect Authorization = "DockerServiceInspect"
  1029. OperationDockerServiceLogs Authorization = "DockerServiceLogs"
  1030. OperationDockerServiceCreate Authorization = "DockerServiceCreate"
  1031. OperationDockerServiceUpdate Authorization = "DockerServiceUpdate"
  1032. OperationDockerServiceDelete Authorization = "DockerServiceDelete"
  1033. OperationDockerSecretList Authorization = "DockerSecretList"
  1034. OperationDockerSecretInspect Authorization = "DockerSecretInspect"
  1035. OperationDockerSecretCreate Authorization = "DockerSecretCreate"
  1036. OperationDockerSecretUpdate Authorization = "DockerSecretUpdate"
  1037. OperationDockerSecretDelete Authorization = "DockerSecretDelete"
  1038. OperationDockerConfigList Authorization = "DockerConfigList"
  1039. OperationDockerConfigInspect Authorization = "DockerConfigInspect"
  1040. OperationDockerConfigCreate Authorization = "DockerConfigCreate"
  1041. OperationDockerConfigUpdate Authorization = "DockerConfigUpdate"
  1042. OperationDockerConfigDelete Authorization = "DockerConfigDelete"
  1043. OperationDockerTaskList Authorization = "DockerTaskList"
  1044. OperationDockerTaskInspect Authorization = "DockerTaskInspect"
  1045. OperationDockerTaskLogs Authorization = "DockerTaskLogs"
  1046. OperationDockerPluginList Authorization = "DockerPluginList"
  1047. OperationDockerPluginPrivileges Authorization = "DockerPluginPrivileges"
  1048. OperationDockerPluginInspect Authorization = "DockerPluginInspect"
  1049. OperationDockerPluginPull Authorization = "DockerPluginPull"
  1050. OperationDockerPluginCreate Authorization = "DockerPluginCreate"
  1051. OperationDockerPluginEnable Authorization = "DockerPluginEnable"
  1052. OperationDockerPluginDisable Authorization = "DockerPluginDisable"
  1053. OperationDockerPluginPush Authorization = "DockerPluginPush"
  1054. OperationDockerPluginUpgrade Authorization = "DockerPluginUpgrade"
  1055. OperationDockerPluginSet Authorization = "DockerPluginSet"
  1056. OperationDockerPluginDelete Authorization = "DockerPluginDelete"
  1057. OperationDockerSessionStart Authorization = "DockerSessionStart"
  1058. OperationDockerDistributionInspect Authorization = "DockerDistributionInspect"
  1059. OperationDockerBuildPrune Authorization = "DockerBuildPrune"
  1060. OperationDockerBuildCancel Authorization = "DockerBuildCancel"
  1061. OperationDockerPing Authorization = "DockerPing"
  1062. OperationDockerInfo Authorization = "DockerInfo"
  1063. OperationDockerEvents Authorization = "DockerEvents"
  1064. OperationDockerSystem Authorization = "DockerSystem"
  1065. OperationDockerVersion Authorization = "DockerVersion"
  1066. OperationDockerAgentPing Authorization = "DockerAgentPing"
  1067. OperationDockerAgentList Authorization = "DockerAgentList"
  1068. OperationDockerAgentHostInfo Authorization = "DockerAgentHostInfo"
  1069. OperationDockerAgentBrowseDelete Authorization = "DockerAgentBrowseDelete"
  1070. OperationDockerAgentBrowseGet Authorization = "DockerAgentBrowseGet"
  1071. OperationDockerAgentBrowseList Authorization = "DockerAgentBrowseList"
  1072. OperationDockerAgentBrowsePut Authorization = "DockerAgentBrowsePut"
  1073. OperationDockerAgentBrowseRename Authorization = "DockerAgentBrowseRename"
  1074. OperationPortainerDockerHubInspect Authorization = "PortainerDockerHubInspect"
  1075. OperationPortainerDockerHubUpdate Authorization = "PortainerDockerHubUpdate"
  1076. OperationPortainerEndpointGroupCreate Authorization = "PortainerEndpointGroupCreate"
  1077. OperationPortainerEndpointGroupList Authorization = "PortainerEndpointGroupList"
  1078. OperationPortainerEndpointGroupDelete Authorization = "PortainerEndpointGroupDelete"
  1079. OperationPortainerEndpointGroupInspect Authorization = "PortainerEndpointGroupInspect"
  1080. OperationPortainerEndpointGroupUpdate Authorization = "PortainerEndpointGroupEdit"
  1081. OperationPortainerEndpointGroupAccess Authorization = "PortainerEndpointGroupAccess "
  1082. OperationPortainerEndpointList Authorization = "PortainerEndpointList"
  1083. OperationPortainerEndpointInspect Authorization = "PortainerEndpointInspect"
  1084. OperationPortainerEndpointCreate Authorization = "PortainerEndpointCreate"
  1085. OperationPortainerEndpointExtensionAdd Authorization = "PortainerEndpointExtensionAdd"
  1086. OperationPortainerEndpointJob Authorization = "PortainerEndpointJob"
  1087. OperationPortainerEndpointSnapshots Authorization = "PortainerEndpointSnapshots"
  1088. OperationPortainerEndpointSnapshot Authorization = "PortainerEndpointSnapshot"
  1089. OperationPortainerEndpointUpdate Authorization = "PortainerEndpointUpdate"
  1090. OperationPortainerEndpointUpdateAccess Authorization = "PortainerEndpointUpdateAccess"
  1091. OperationPortainerEndpointDelete Authorization = "PortainerEndpointDelete"
  1092. OperationPortainerEndpointExtensionRemove Authorization = "PortainerEndpointExtensionRemove"
  1093. OperationPortainerExtensionList Authorization = "PortainerExtensionList"
  1094. OperationPortainerExtensionInspect Authorization = "PortainerExtensionInspect"
  1095. OperationPortainerExtensionCreate Authorization = "PortainerExtensionCreate"
  1096. OperationPortainerExtensionUpdate Authorization = "PortainerExtensionUpdate"
  1097. OperationPortainerExtensionDelete Authorization = "PortainerExtensionDelete"
  1098. OperationPortainerMOTD Authorization = "PortainerMOTD"
  1099. OperationPortainerRegistryList Authorization = "PortainerRegistryList"
  1100. OperationPortainerRegistryInspect Authorization = "PortainerRegistryInspect"
  1101. OperationPortainerRegistryCreate Authorization = "PortainerRegistryCreate"
  1102. OperationPortainerRegistryConfigure Authorization = "PortainerRegistryConfigure"
  1103. OperationPortainerRegistryUpdate Authorization = "PortainerRegistryUpdate"
  1104. OperationPortainerRegistryUpdateAccess Authorization = "PortainerRegistryUpdateAccess"
  1105. OperationPortainerRegistryDelete Authorization = "PortainerRegistryDelete"
  1106. OperationPortainerResourceControlCreate Authorization = "PortainerResourceControlCreate"
  1107. OperationPortainerResourceControlUpdate Authorization = "PortainerResourceControlUpdate"
  1108. OperationPortainerResourceControlDelete Authorization = "PortainerResourceControlDelete"
  1109. OperationPortainerRoleList Authorization = "PortainerRoleList"
  1110. OperationPortainerRoleInspect Authorization = "PortainerRoleInspect"
  1111. OperationPortainerRoleCreate Authorization = "PortainerRoleCreate"
  1112. OperationPortainerRoleUpdate Authorization = "PortainerRoleUpdate"
  1113. OperationPortainerRoleDelete Authorization = "PortainerRoleDelete"
  1114. OperationPortainerScheduleList Authorization = "PortainerScheduleList"
  1115. OperationPortainerScheduleInspect Authorization = "PortainerScheduleInspect"
  1116. OperationPortainerScheduleFile Authorization = "PortainerScheduleFile"
  1117. OperationPortainerScheduleTasks Authorization = "PortainerScheduleTasks"
  1118. OperationPortainerScheduleCreate Authorization = "PortainerScheduleCreate"
  1119. OperationPortainerScheduleUpdate Authorization = "PortainerScheduleUpdate"
  1120. OperationPortainerScheduleDelete Authorization = "PortainerScheduleDelete"
  1121. OperationPortainerSettingsInspect Authorization = "PortainerSettingsInspect"
  1122. OperationPortainerSettingsUpdate Authorization = "PortainerSettingsUpdate"
  1123. OperationPortainerSettingsLDAPCheck Authorization = "PortainerSettingsLDAPCheck"
  1124. OperationPortainerStackList Authorization = "PortainerStackList"
  1125. OperationPortainerStackInspect Authorization = "PortainerStackInspect"
  1126. OperationPortainerStackFile Authorization = "PortainerStackFile"
  1127. OperationPortainerStackCreate Authorization = "PortainerStackCreate"
  1128. OperationPortainerStackMigrate Authorization = "PortainerStackMigrate"
  1129. OperationPortainerStackUpdate Authorization = "PortainerStackUpdate"
  1130. OperationPortainerStackDelete Authorization = "PortainerStackDelete"
  1131. OperationPortainerTagList Authorization = "PortainerTagList"
  1132. OperationPortainerTagCreate Authorization = "PortainerTagCreate"
  1133. OperationPortainerTagDelete Authorization = "PortainerTagDelete"
  1134. OperationPortainerTeamMembershipList Authorization = "PortainerTeamMembershipList"
  1135. OperationPortainerTeamMembershipCreate Authorization = "PortainerTeamMembershipCreate"
  1136. OperationPortainerTeamMembershipUpdate Authorization = "PortainerTeamMembershipUpdate"
  1137. OperationPortainerTeamMembershipDelete Authorization = "PortainerTeamMembershipDelete"
  1138. OperationPortainerTeamList Authorization = "PortainerTeamList"
  1139. OperationPortainerTeamInspect Authorization = "PortainerTeamInspect"
  1140. OperationPortainerTeamMemberships Authorization = "PortainerTeamMemberships"
  1141. OperationPortainerTeamCreate Authorization = "PortainerTeamCreate"
  1142. OperationPortainerTeamUpdate Authorization = "PortainerTeamUpdate"
  1143. OperationPortainerTeamDelete Authorization = "PortainerTeamDelete"
  1144. OperationPortainerTemplateList Authorization = "PortainerTemplateList"
  1145. OperationPortainerTemplateInspect Authorization = "PortainerTemplateInspect"
  1146. OperationPortainerTemplateCreate Authorization = "PortainerTemplateCreate"
  1147. OperationPortainerTemplateUpdate Authorization = "PortainerTemplateUpdate"
  1148. OperationPortainerTemplateDelete Authorization = "PortainerTemplateDelete"
  1149. OperationPortainerUploadTLS Authorization = "PortainerUploadTLS"
  1150. OperationPortainerUserList Authorization = "PortainerUserList"
  1151. OperationPortainerUserInspect Authorization = "PortainerUserInspect"
  1152. OperationPortainerUserMemberships Authorization = "PortainerUserMemberships"
  1153. OperationPortainerUserCreate Authorization = "PortainerUserCreate"
  1154. OperationPortainerUserUpdate Authorization = "PortainerUserUpdate"
  1155. OperationPortainerUserUpdatePassword Authorization = "PortainerUserUpdatePassword"
  1156. OperationPortainerUserDelete Authorization = "PortainerUserDelete"
  1157. OperationPortainerWebsocketExec Authorization = "PortainerWebsocketExec"
  1158. OperationPortainerWebhookList Authorization = "PortainerWebhookList"
  1159. OperationPortainerWebhookCreate Authorization = "PortainerWebhookCreate"
  1160. OperationPortainerWebhookDelete Authorization = "PortainerWebhookDelete"
  1161. OperationIntegrationStoridgeAdmin Authorization = "IntegrationStoridgeAdmin"
  1162. OperationDockerUndefined Authorization = "DockerUndefined"
  1163. OperationDockerAgentUndefined Authorization = "DockerAgentUndefined"
  1164. OperationPortainerUndefined Authorization = "PortainerUndefined"
  1165. EndpointResourcesAccess Authorization = "EndpointResourcesAccess"
  1166. )