예제 #1
0
def test_address_from_path():
    builder = OperationRequestBuilder()
    builder.address_from('/subsystem=datasources/data-source=DemoDS')
    request = builder.build()

    assert request == dict(
        address=[{'subsystem': 'datasources'}, {'data-source': 'DemoDS'}])
예제 #2
0
def write_attribute(path, name, value):
    builder = OperationRequestBuilder()
    builder.address_from(path)
    builder.write(name, value)
    return builder.build()
예제 #3
0
def remove(path):
    builder = OperationRequestBuilder()
    builder.address_from(path)
    builder.remove()
    return builder.build()
예제 #4
0
def execute(operation, parameters, path):
    builder = OperationRequestBuilder()
    builder.address_from(path)
    builder.payload(parameters)
    builder.operation(operation)
    return builder.build()
예제 #5
0
def add(path, attributes):
    builder = OperationRequestBuilder()
    builder.address_from(path)
    builder.add()
    builder.payload(attributes)
    return builder.build()