@@ -743,6 +743,51 @@ class GroupBoardManager(CRUDMixin, RESTManager):
743
743
_create_attrs = (("name" ,), tuple ())
744
744
745
745
746
+ class GroupCluster (SaveMixin , ObjectDeleteMixin , RESTObject ):
747
+ pass
748
+
749
+
750
+ class GroupClusterManager (CRUDMixin , RESTManager ):
751
+ _path = "/groups/%(group_id)s/clusters"
752
+ _obj_cls = GroupCluster
753
+ _from_parent_attrs = {"group_id" : "id" }
754
+ _create_attrs = (
755
+ ("name" , "platform_kubernetes_attributes" ,),
756
+ ("domain" , "enabled" , "managed" , "environment_scope" ,),
757
+ )
758
+ _update_attrs = (
759
+ tuple (),
760
+ (
761
+ "name" ,
762
+ "domain" ,
763
+ "management_project_id" ,
764
+ "platform_kubernetes_attributes" ,
765
+ "environment_scope" ,
766
+ ),
767
+ )
768
+
769
+ @exc .on_http_error (exc .GitlabStopError )
770
+ def create (self , data , ** kwargs ):
771
+ """Create a new object.
772
+
773
+ Args:
774
+ data (dict): Parameters to send to the server to create the
775
+ resource
776
+ **kwargs: Extra options to send to the server (e.g. sudo or
777
+ 'ref_name', 'stage', 'name', 'all')
778
+
779
+ Raises:
780
+ GitlabAuthenticationError: If authentication is not correct
781
+ GitlabCreateError: If the server cannot perform the request
782
+
783
+ Returns:
784
+ RESTObject: A new instance of the manage object class build with
785
+ the data sent by the server
786
+ """
787
+ path = "%s/user" % (self .path )
788
+ return CreateMixin .create (self , data , path = path , ** kwargs )
789
+
790
+
746
791
class GroupCustomAttribute (ObjectDeleteMixin , RESTObject ):
747
792
_id_attr = "key"
748
793
@@ -1150,6 +1195,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
1150
1195
("projects" , "GroupProjectManager" ),
1151
1196
("subgroups" , "GroupSubgroupManager" ),
1152
1197
("variables" , "GroupVariableManager" ),
1198
+ ("clusters" , "GroupClusterManager" ),
1153
1199
)
1154
1200
1155
1201
@cli .register_custom_action ("Group" , ("to_project_id" ,))
@@ -1599,6 +1645,51 @@ class ProjectBranchManager(NoUpdateMixin, RESTManager):
1599
1645
_create_attrs = (("branch" , "ref" ), tuple ())
1600
1646
1601
1647
1648
+ class ProjectCluster (SaveMixin , ObjectDeleteMixin , RESTObject ):
1649
+ pass
1650
+
1651
+
1652
+ class ProjectClusterManager (CRUDMixin , RESTManager ):
1653
+ _path = "/projects/%(project_id)s/clusters"
1654
+ _obj_cls = ProjectCluster
1655
+ _from_parent_attrs = {"project_id" : "id" }
1656
+ _create_attrs = (
1657
+ ("name" , "platform_kubernetes_attributes" ,),
1658
+ ("domain" , "enabled" , "managed" , "environment_scope" ,),
1659
+ )
1660
+ _update_attrs = (
1661
+ tuple (),
1662
+ (
1663
+ "name" ,
1664
+ "domain" ,
1665
+ "management_project_id" ,
1666
+ "platform_kubernetes_attributes" ,
1667
+ "environment_scope" ,
1668
+ ),
1669
+ )
1670
+
1671
+ @exc .on_http_error (exc .GitlabStopError )
1672
+ def create (self , data , ** kwargs ):
1673
+ """Create a new object.
1674
+
1675
+ Args:
1676
+ data (dict): Parameters to send to the server to create the
1677
+ resource
1678
+ **kwargs: Extra options to send to the server (e.g. sudo or
1679
+ 'ref_name', 'stage', 'name', 'all')
1680
+
1681
+ Raises:
1682
+ GitlabAuthenticationError: If authentication is not correct
1683
+ GitlabCreateError: If the server cannot perform the request
1684
+
1685
+ Returns:
1686
+ RESTObject: A new instance of the manage object class build with
1687
+ the data sent by the server
1688
+ """
1689
+ path = "%s/user" % (self .path )
1690
+ return CreateMixin .create (self , data , path = path , ** kwargs )
1691
+
1692
+
1602
1693
class ProjectCustomAttribute (ObjectDeleteMixin , RESTObject ):
1603
1694
_id_attr = "key"
1604
1695
@@ -3940,6 +4031,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
3940
4031
("triggers" , "ProjectTriggerManager" ),
3941
4032
("variables" , "ProjectVariableManager" ),
3942
4033
("wikis" , "ProjectWikiManager" ),
4034
+ ("clusters" , "ProjectClusterManager" ),
3943
4035
)
3944
4036
3945
4037
@cli .register_custom_action ("Project" , ("submodule" , "branch" , "commit_sha" ))
0 commit comments