@@ -743,6 +743,51 @@ 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+ ("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+
746791class GroupCustomAttribute (ObjectDeleteMixin ,RESTObject ):
747792_id_attr = "key"
748793
@@ -1150,6 +1195,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
11501195 ("projects" ,"GroupProjectManager" ),
11511196 ("subgroups" ,"GroupSubgroupManager" ),
11521197 ("variables" ,"GroupVariableManager" ),
1198+ ("clusters" ,"GroupClusterManager" ),
11531199 )
11541200
11551201@cli .register_custom_action ("Group" , ("to_project_id" ,))
@@ -1599,6 +1645,51 @@ class ProjectBranchManager(NoUpdateMixin, RESTManager):
15991645_create_attrs = (("branch" ,"ref" ),tuple ())
16001646
16011647
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+
16021693class ProjectCustomAttribute (ObjectDeleteMixin ,RESTObject ):
16031694_id_attr = "key"
16041695
@@ -3943,6 +4034,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
39434034 ("triggers" ,"ProjectTriggerManager" ),
39444035 ("variables" ,"ProjectVariableManager" ),
39454036 ("wikis" ,"ProjectWikiManager" ),
4037+ ("clusters" ,"ProjectClusterManager" ),
39464038 )
39474039
39484040@cli .register_custom_action ("Project" , ("submodule" ,"branch" ,"commit_sha" ))