@@ -743,6 +743,57 @@ class GroupBoardManager(CRUDMixin, RESTManager):
743743_create_attrs = (("name" ,),tuple ())
744744
745745
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+ "platform_kubernetes_attributes" ,
761+ "environment_scope" ,
762+ ),
763+ )
764+ _update_attrs = (
765+ tuple (),
766+ (
767+ "name" ,
768+ "domain" ,
769+ "management_project_id" ,
770+ "platform_kubernetes_attributes" ,
771+ "environment_scope" ,
772+ ),
773+ )
774+
775+ @exc .on_http_error (exc .GitlabStopError )
776+ def create (self ,data ,** kwargs ):
777+ """Create a new object.
778+
779+ Args:
780+ data (dict): Parameters to send to the server to create the
781+ resource
782+ **kwargs: Extra options to send to the server (e.g. sudo or
783+ 'ref_name', 'stage', 'name', 'all')
784+
785+ Raises:
786+ GitlabAuthenticationError: If authentication is not correct
787+ GitlabCreateError: If the server cannot perform the request
788+
789+ Returns:
790+ RESTObject: A new instance of the manage object class build with
791+ the data sent by the server
792+ """
793+ path = "%s/user" % (self .path )
794+ return CreateMixin .create (self ,data ,path = path ,** kwargs )
795+
796+
746797class GroupCustomAttribute (ObjectDeleteMixin ,RESTObject ):
747798_id_attr = "key"
748799
@@ -1150,6 +1201,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
11501201 ("projects" ,"GroupProjectManager" ),
11511202 ("subgroups" ,"GroupSubgroupManager" ),
11521203 ("variables" ,"GroupVariableManager" ),
1204+ ("clusters" ,"GroupClusterManager" ),
11531205 )
11541206
11551207@cli .register_custom_action ("Group" , ("to_project_id" ,))
@@ -1599,6 +1651,57 @@ class ProjectBranchManager(NoUpdateMixin, RESTManager):
15991651_create_attrs = (("branch" ,"ref" ),tuple ())
16001652
16011653
1654+ class ProjectCluster (SaveMixin ,ObjectDeleteMixin ,RESTObject ):
1655+ pass
1656+
1657+
1658+ class ProjectClusterManager (CRUDMixin ,RESTManager ):
1659+ _path = "/projects/%(project_id)s/clusters"
1660+ _obj_cls = ProjectCluster
1661+ _from_parent_attrs = {"project_id" :"id" }
1662+ _create_attrs = (
1663+ ("name" ,"platform_kubernetes_attributes" ,),
1664+ (
1665+ "domain" ,
1666+ "enabled" ,
1667+ "managed" ,
1668+ "platform_kubernetes_attributes" ,
1669+ "environment_scope" ,
1670+ ),
1671+ )
1672+ _update_attrs = (
1673+ tuple (),
1674+ (
1675+ "name" ,
1676+ "domain" ,
1677+ "management_project_id" ,
1678+ "platform_kubernetes_attributes" ,
1679+ "environment_scope" ,
1680+ ),
1681+ )
1682+
1683+ @exc .on_http_error (exc .GitlabStopError )
1684+ def create (self ,data ,** kwargs ):
1685+ """Create a new object.
1686+
1687+ Args:
1688+ data (dict): Parameters to send to the server to create the
1689+ resource
1690+ **kwargs: Extra options to send to the server (e.g. sudo or
1691+ 'ref_name', 'stage', 'name', 'all')
1692+
1693+ Raises:
1694+ GitlabAuthenticationError: If authentication is not correct
1695+ GitlabCreateError: If the server cannot perform the request
1696+
1697+ Returns:
1698+ RESTObject: A new instance of the manage object class build with
1699+ the data sent by the server
1700+ """
1701+ path = "%s/user" % (self .path )
1702+ return CreateMixin .create (self ,data ,path = path ,** kwargs )
1703+
1704+
16021705class ProjectCustomAttribute (ObjectDeleteMixin ,RESTObject ):
16031706_id_attr = "key"
16041707
@@ -3943,6 +4046,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
39434046 ("triggers" ,"ProjectTriggerManager" ),
39444047 ("variables" ,"ProjectVariableManager" ),
39454048 ("wikis" ,"ProjectWikiManager" ),
4049+ ("clusters" ,"ProjectClusterManager" ),
39464050 )
39474051
39484052@cli .register_custom_action ("Project" , ("submodule" ,"branch" ,"commit_sha" ))