Exemplo n.º 1
0
 def Run(self, args):
     xpn_client = xpn_api.GetXpnClient()
     xpn_types = xpn_client.messages.XpnResourceId.TypeValueValuesEnum
     resources = xpn_client.ListEnabledResources(args.project)
     return [
         resource for resource in resources
         if resource.type == xpn_types.PROJECT
     ]
 def _SetUp(self, track):
     self.track = track
     self.StartPatch('googlecloudsdk.core.credentials.http.Http',
                     autospec=True)
     self.xpn_client = mock.Mock(autospec=xpn_api.XpnClient)
     client = xpn_api.GetXpnClient(self.track)
     self.messages = client.messages
     self.xpn_client.messages = client.messages
     self.get_xpn_client_mock = self.StartObjectPatch(
         xpn_api, 'GetXpnClient', return_value=self.xpn_client)
Exemplo n.º 3
0
 def Run(self, args):
     xpn_client = xpn_api.GetXpnClient()
     xpn_client.DisableHost(args.project)
Exemplo n.º 4
0
 def Run(self, args):
     xpn_client = xpn_api.GetXpnClient(self.ReleaseTrack())
     xpn_client.EnableHost(args.project)
Exemplo n.º 5
0
 def Run(self, args):
     xpn_client = xpn_api.GetXpnClient()
     project = properties.VALUES.core.project.Get(required=True)
     organization_id = args.id
     return xpn_client.ListOrganizationHostProjects(
         project, organization_id=organization_id)
Exemplo n.º 6
0
 def Run(self, args):
     xpn_client = xpn_api.GetXpnClient(self.ReleaseTrack())
     xpn_client.DisableXpnAssociatedProject(args.host_project, args.project)
Exemplo n.º 7
0
 def Run(self, args):
   xpn_client = xpn_api.GetXpnClient(self.ReleaseTrack())
   return xpn_client.GetHostProject(args.project)
Exemplo n.º 8
0
 def Run(self, args):
     xpn_client = xpn_api.GetXpnClient()
     return xpn_client.ListEnabledResources(args.project).resources
Exemplo n.º 9
0
 def Run(self, args):
     xpn_client = xpn_api.GetXpnClient()
     return xpn_client.GetHostProject(args.project)
Exemplo n.º 10
0
 def Run(self, args):
     xpn_client = xpn_api.GetXpnClient()
     xpn_client.EnableXpnAssociatedProject(args.host_project, args.project)
Exemplo n.º 11
0
 def SetUp(self):
     self.SelectApi(_DEFAULT_API_VERSION)
     self.xpn_client = xpn_api.GetXpnClient(calliope_base.ReleaseTrack.GA)
Exemplo n.º 12
0
 def Run(self, args):
   xpn_client = xpn_api.GetXpnClient(self.ReleaseTrack())
   return xpn_client.ListEnabledResources(args.project)
Exemplo n.º 13
0
 def Run(self, args):
     xpn_client = xpn_api.GetXpnClient(api_version='beta')
     return xpn_client.GetHostProject(args.project)