@@ -743,6 +743,56 @@ 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
+ (
757
+ "domain" ,
758
+ "enabled" ,
759
+ "managed" ,
760
+ "environment_scope" ,
761
+ ),
762
+ )
763
+ _update_attrs = (
764
+ tuple (),
765
+ (
766
+ "name" ,
767
+ "domain" ,
768
+ "management_project_id" ,
769
+ "platform_kubernetes_attributes" ,
770
+ "environment_scope" ,
771
+ ),
772
+ )
773
+
774
+ @exc .on_http_error (exc .GitlabStopError )
775
+ def create (self , data , ** kwargs ):
776
+ """Create a new object.
777
+
778
+ Args:
779
+ data (dict): Parameters to send to the server to create the
780
+ resource
781
+ **kwargs: Extra options to send to the server (e.g. sudo or
782
+ 'ref_name', 'stage', 'name', 'all')
783
+
784
+ Raises:
785
+ GitlabAuthenticationError: If authentication is not correct
786
+ GitlabCreateError: If the server cannot perform the request
787
+
788
+ Returns:
789
+ RESTObject: A new instance of the manage object class build with
790
+ the data sent by the server
791
+ """
792
+ path = "%s/user" % (self .path )
793
+ return CreateMixin .create (self , data , path = path , ** kwargs )
794
+
795
+
746
796
class GroupCustomAttribute (ObjectDeleteMixin , RESTObject ):
747
797
_id_attr = "key"
748
798
@@ -1150,6 +1200,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
1150
1200
("projects" , "GroupProjectManager" ),
1151
1201
("subgroups" , "GroupSubgroupManager" ),
1152
1202
("variables" , "GroupVariableManager" ),
1203
+ ("clusters" , "GroupClusterManager" ),
1153
1204
)
1154
1205
1155
1206
@cli .register_custom_action ("Group" , ("to_project_id" ,))
@@ -1599,6 +1650,56 @@ class ProjectBranchManager(NoUpdateMixin, RESTManager):
1599
1650
_create_attrs = (("branch" , "ref" ), tuple ())
1600
1651
1601
1652
1653
+ class ProjectCluster (SaveMixin , ObjectDeleteMixin , RESTObject ):
1654
+ pass
1655
+
1656
+
1657
+ class ProjectClusterManager (CRUDMixin , RESTManager ):
1658
+ _path = "/projects/%(project_id)s/clusters"
1659
+ _obj_cls = ProjectCluster
1660
+ _from_parent_attrs = {"project_id" : "id" }
1661
+ _create_attrs = (
1662
+ ("name" , "platform_kubernetes_attributes" ,),
1663
+ (
1664
+ "domain" ,
1665
+ "enabled" ,
1666
+ "managed" ,
1667
+ "environment_scope" ,
1668
+ ),
1669
+ )
1670
+ _update_attrs = (
1671
+ tuple (),
1672
+ (
1673
+ "name" ,
1674
+ "domain" ,
1675
+ "management_project_id" ,
1676
+ "platform_kubernetes_attributes" ,
1677
+ "environment_scope" ,
1678
+ ),
1679
+ )
1680
+
1681
+ @exc .on_http_error (exc .GitlabStopError )
1682
+ def create (self , data , ** kwargs ):
1683
+ """Create a new object.
1684
+
1685
+ Args:
1686
+ data (dict): Parameters to send to the server to create the
1687
+ resource
1688
+ **kwargs: Extra options to send to the server (e.g. sudo or
1689
+ 'ref_name', 'stage', 'name', 'all')
1690
+
1691
+ Raises:
1692
+ GitlabAuthenticationError: If authentication is not correct
1693
+ GitlabCreateError: If the server cannot perform the request
1694
+
1695
+ Returns:
1696
+ RESTObject: A new instance of the manage object class build with
1697
+ the data sent by the server
1698
+ """
1699
+ path = "%s/user" % (self .path )
1700
+ return CreateMixin .create (self , data , path = path , ** kwargs )
1701
+
1702
+
1602
1703
class ProjectCustomAttribute (ObjectDeleteMixin , RESTObject ):
1603
1704
_id_attr = "key"
1604
1705
@@ -3943,6 +4044,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
3943
4044
("triggers" , "ProjectTriggerManager" ),
3944
4045
("variables" , "ProjectVariableManager" ),
3945
4046
("wikis" , "ProjectWikiManager" ),
4047
+ ("clusters" , "ProjectClusterManager" ),
3946
4048
)
3947
4049
3948
4050
@cli .register_custom_action ("Project" , ("submodule" , "branch" , "commit_sha" ))
0 commit comments