def Run(self, args): """Run the list command.""" with endpoint_util.AssuredWorkloadsEndpointOverridesFromRegion( release_track=self.ReleaseTrack(), region=args.location): client = apis.WorkloadsClient(release_track=self.ReleaseTrack()) return client.List(parent=message_util.CreateAssuredParent( args.organization, args.location), limit=args.limit, page_size=args.page_size)
def Run(self, args): """Run the create command.""" with endpoint_util.AssuredWorkloadsEndpointOverridesFromRegion( release_track=six.text_type(self.ReleaseTrack()), region=args.location): parent = message_util.CreateAssuredParent( organization_id=args.organization, location=args.location) workload = message_util.CreateBetaAssuredWorkload( display_name=args.display_name, compliance_regime=args.compliance_regime, billing_account=args.billing_account, next_rotation_time=args.next_rotation_time, rotation_period=args.rotation_period, labels=args.labels) client = apis.WorkloadsClient(release_track=self.ReleaseTrack()) self.created_resource = client.Create( external_id=args.external_identifier, parent=parent, workload=workload) return self.created_resource