def _ExpectListPerInstanceConfigs(self): request = ( self.messages. ComputeRegionInstanceGroupManagersListPerInstanceConfigsRequest)( filter='name eq foo'.format(project_uri=self.project_uri), instanceGroupManager='group-1', maxResults=1, project='fake-project', region='us-central2', ) preserved_state_disks = [ config_utils.MakePreservedStateDiskMapEntry( self.messages, 'foo', (self.project_uri + '/zones/us-central2-a/disks/foo'), 'READ_WRITE'), config_utils.MakePreservedStateDiskMapEntry( self.messages, 'baz', (self.project_uri + '/zones/us-central2-a/disks/baz'), 'READ_ONLY'), ] items = [ config_utils.MakePerInstanceConfig(self.messages, 'foo', preserved_state_disks, self.preserved_state_metadata), ] response = self.messages.RegionInstanceGroupManagersListInstanceConfigsResp( items=items) self.client.regionInstanceGroupManagers.ListPerInstanceConfigs.Expect( request, response=response, )
def _ExpectUpdatePerInstanceConfigs(self, preserved_state_disks, preserved_state_metadata): request = ( self.messages. ComputeRegionInstanceGroupManagersUpdatePerInstanceConfigsRequest)( instanceGroupManager='group-1', regionInstanceGroupManagerUpdateInstanceConfigReq=( self.messages. RegionInstanceGroupManagerUpdateInstanceConfigReq)( perInstanceConfigs=[ config_utils.MakePerInstanceConfig( self.messages, 'foo', preserved_state_disks, preserved_state_metadata), ], ), project='fake-project', region='us-central2', ) response = self.messages.Operation( selfLink=(self.project_uri + '/regions/us-central2/operations/foo'), ) self.client.regionInstanceGroupManagers.UpdatePerInstanceConfigs.Expect( request, response=response, )