Пример #1
0
def Stop(xrn, creds):
    pm.check_permissions('Stop', locals())
    try:
        slice_action = aggregate.stop_slice(xrn)
    except Exception as e:
        raise OCFSfaError(e, 'Stop')
    return {
        'output': '',
        'geni_api': 2,
        'code': {
            'am_type': 'sfa',
            'geni_code': 0
        },
        'value': slice_action
    }  #driver.crud_slice (slice_urn,authority,credentials,action='stop_slice')
Пример #2
0
def CreateSliver(slice_xrn, creds, rspec, users, options):
    #pm.check_permissions('CreateSliver',locals())
    try:
        rspec = aggregate.CreateSliver(slice_xrn, rspec, users, creds, options)
    except Exception as e:
        raise OCFSfaError(e, 'CreateSliver')

    to_return = {
        'output': '',
        'geni_api': 2,
        'code': {
            'am_type': 'sfa',
            'geni_code': 0
        },
        'value': rspec
    }
    return to_return  #driver.create_sliver(slice_urn,slice_leaf,authority,rspec,users,options)
Пример #3
0
def DeleteSliver(xrn, creds, options, **kwargs):
    #pm.check_permissions('DeleteSliver',locals())
    #DSCredVal(slice_urn,credentials,options)
    try:
        rspec = aggregate.DeleteSliver(xrn, options)
    except Exception as e:
        raise OCFSfaError(e, 'DeleteSliver')

    to_return = {
        'output': '',
        'geni_api': 2,
        'code': {
            'am_type': 'sfa',
            'geni_code': 0
        },
        'value': rspec
    }
    return to_return  #driver.crud_slice(slice_urn,authority,credentials,action='delete_slice')
Пример #4
0
def SliverStatus(slice_xrn, creds, options):
    #pm.check_permissions('SliverStatus',locals())
    #SSCredVal(slice_urn,credentials,options)
    try:
        resources = aggregate.SliverStatus(slice_xrn, options)
    except Exception as e:
        raise OCFSfaError(e, 'SliverStatus')
    struct = {
        "geni_urn": slice_xrn,
        "geni_status": "ready",
        "geni_resources": resources
    }
    to_return = {
        'output': '',
        'geni_api': 2,
        'code': {
            'am_type': 'sfa',
            'geni_code': 0
        },
        'value': struct
    }
    return to_return  #driver.sliver_status(slice_urn,authority,credentials,options)