bored-barista-23480
01/21/2022, 1:10 PMechoing-dinner-19531
01/21/2022, 1:58 PMCreateResult
is just a map object. So you should be able to do something like:
class MyProvider(ResourceProvider):
def create(self, inputs):
outputs = {}
outputs["x"] = inputs["x"]
outputs["y]" = "some value"
return CreateResult("SomeID", outputs)
bored-barista-23480
01/21/2022, 2:32 PMechoing-dinner-19531
01/21/2022, 2:56 PMclass X(dyn.Resource):
x: Output[str]
y: Output[str]
__init__
as well:
class X(dyn.Resource):
x: Output[str]
y: Output[str]
def __init__(self, name: str, args: XInputs, opts = None):
ins = vars(args)
ins["y"] = None
super().__init__(XProvider(), name, ins, opts)
bored-barista-23480
01/21/2022, 3:23 PMerror: Exception calling application: unsupported operand type(s) for <<: 'int' and 'float'
echoing-dinner-19531
01/21/2022, 3:58 PMbored-barista-23480
01/21/2022, 4:13 PMint
or float
, apart from an input (length
) that did not produce this error previously. In the create method I set set it to "test"
as you described above.
class RSAKeyPair(Resource):
file_name: Output[str]
file_location: Output[str]
length: Output[int]
public_key_data: Output[str]
def __init__(self, name: str, args: RSAKeyPairInputs, opts = None):
ins = vars(args)
ins["public_key_data"] = None
super().__init__(RSAKeyPairProvider(), name, ins, opts)
echoing-dinner-19531
01/21/2022, 4:17 PM<<
)? I'd look around that and maybe add some type castsbored-barista-23480
01/21/2022, 4:33 PMfloat
, and therefor a method expecting an int
creates that error. But that only happens once the initial error - the missing attribute of the resource - is resolved. That confused me. Now it works perfectly.
Thank you very much! 🙂