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.
 
 
 
 
 
 

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