Class: UploadData
activity/script/command.UploadData
Generic command that can be send to an exe-unit via yagna's API
Hierarchy
↳
UploadData
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new UploadData(storageProvider
, src
, dstPath
): UploadData
Parameters
Name | Type |
---|---|
storageProvider | StorageProvider |
src | Uint8Array |
dstPath | string |
Returns
Overrides
Defined in
src/activity/script/command.ts:139
Properties
from
• Protected
Optional
from: string
Inherited from
Defined in
src/activity/script/command.ts:110
to
• Protected
Optional
to: string
Inherited from
Defined in
src/activity/script/command.ts:111
args
• Protected
args: Record
<string
, unknown
>
Inherited from
Defined in
src/activity/script/command.ts:16
Methods
before
▸ before(): Promise
<void
>
Setup local environment for executing this command.
Returns
Promise
<void
>
Overrides
Defined in
src/activity/script/command.ts:148
after
▸ after(result
): Promise
<Result
<any
>>
Cleanup local setup that was needed for the command to run.
It is called after the command was sent to the activity, and the command was processed.
When run within scripts or batch commands, after() might be called without any results, as one of the previous commands might have failed. In this case, the command should still cleanup its local setup and return an empty error result.
Parameters
Name | Type |
---|---|
result | Result <any > |
Returns
Promise
<Result
<any
>>
Overrides
Defined in
src/activity/script/command.ts:152
toJson
▸ toJson(): Object
Serializes the command to a JSON representation
Returns
Object
Inherited from
Defined in
src/activity/script/command.ts:28
toExeScriptRequest
▸ toExeScriptRequest(): ExeScriptRequest
Converts the command into
Returns
ExeScriptRequest