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'}])
def write_attribute(path, name, value): builder = OperationRequestBuilder() builder.address_from(path) builder.write(name, value) return builder.build()
def remove(path): builder = OperationRequestBuilder() builder.address_from(path) builder.remove() return builder.build()
def execute(operation, parameters, path): builder = OperationRequestBuilder() builder.address_from(path) builder.payload(parameters) builder.operation(operation) return builder.build()
def add(path, attributes): builder = OperationRequestBuilder() builder.address_from(path) builder.add() builder.payload(attributes) return builder.build()