def mutate(_root, info, input_object): gmp = get_gmp(info) if input_object.resource_filter is not None: gmp.modify_tag( str(input_object.tag_id), resource_filter=input_object.resource_filter.filter_string, resource_type=EntityType.get(input_object.resource_type), resource_action='add', ) else: gmp.modify_tag( str(input_object.tag_id), resource_ids=input_object.resource_ids, resource_type=EntityType.get(input_object.resource_type), resource_action='add', ) return RemoveTag(ok=True)
def mutate(_root, info, input_object): gmp = get_gmp(info) gmp.modify_tag( str(input_object.tag_id), resource_ids=input_object.resource_ids, resource_type=EntityType.get(input_object.resource_type), resource_action='add', ) return AddTag(ok=True)
def mutate(_root, info, input_object): gmp = get_gmp(info) resp = gmp.create_tag( input_object.name, EntityType.get(input_object.resource_type), resource_ids=input_object.resource_ids, value=input_object.value, comment=input_object.comment, active=input_object.active, ) return CreateTag(tag_id=resp.get('id'))
def mutate(_root, info, input_object): gmp = get_gmp(info) if input_object.resource_type is not None: resource_type = EntityType.get(input_object.resource_type) else: resource_type = None gmp.modify_tag( str(input_object.tag_id), name=input_object.name, comment=input_object.comment, value=input_object.value, active=input_object.active, resource_action=input_object.resource_action, resource_type=resource_type, resource_ids=input_object.resource_ids, ) return ModifyTag(ok=True)