parameters: (self)
docstring: Gets the instance group that the current VM belongs to.
docstring_summary: Gets the instance group that the current VM belongs to.
docstring_tokens: Gets the instance group that the current VM belongs to .
function: def _get_instance_group(self):
      """Gets the instance group that the current VM belongs to."""
      resp = self._compute_service.instances().get(
          project=self._project,
          zone=self._zone,
          instance=self._vm_master,
          fields='metadata').execute()
  
      if 'metadata' in resp and 'items' in resp['metadata']:
        for item in resp['metadata']['items']:
          if (item['key'] == 'created-by' and
              'instanceGroupManagers' in item['value']):
            return ClusterResolver._parse_resource_url(item['value'],
                                                       'instanceGroupManagers')
  
      raise RuntimeError(('A vm list must be passed to ClusterResolver '
                          'if not using an instance group'))
function_tokens: def _get_instance_group ( self ) : resp = self . _compute_service . instances ( ) . get ( project = self . _project , zone = self . _zone , instance = self . _vm_master , fields = 'metadata' ) . execute ( ) if 'metadata' in resp and 'items' in resp [ 'metadata' ] : for item in resp [ 'metadata' ] [ 'items' ] : if ( item [ 'key' ] == 'created-by' and 'instanceGroupManagers' in item [ 'value' ] ) : return ClusterResolver . _parse_resource_url ( item [ 'value' ] , 'instanceGroupManagers' ) raise RuntimeError ( ( 'A vm list must be passed to ClusterResolver ' 'if not using an instance group' ) )