JS API Reference

Class: Activity

activity/activity.Activity

Activity module - an object representing the runtime environment on the provider in accordance with the Package specification. As part of a given activity, it is possible to execute exe script commands and capture their results.

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Activity(id, agreement, currentState?, previousState?, usage): Activity

Parameters

NameTypeDefault valueDescription
idstringundefinedThe ID of the activity in Yagna
agreementAgreementundefinedThe agreement that's related to this activity
currentStateActivityStateEnumActivityStateEnum.NewThe current state as it was obtained from yagna
previousStateActivityStateEnumActivityStateEnum.UnknownThe previous state (or New if this is the first time we're creating the activity)
usageActivityUsageInfoundefinedCurrent resource usage vector information

Returns

Activity

Defined in

src/activity/activity.ts:37

Properties

id

Readonly id: string

The ID of the activity in Yagna

Defined in

src/activity/activity.ts:38


agreement

Readonly agreement: Agreement

The agreement that's related to this activity

Defined in

src/activity/activity.ts:39


currentState

Protected Readonly currentState: ActivityStateEnum = ActivityStateEnum.New

The current state as it was obtained from yagna

Defined in

src/activity/activity.ts:40


previousState

Protected Readonly previousState: ActivityStateEnum = ActivityStateEnum.Unknown

The previous state (or New if this is the first time we're creating the activity)

Defined in

src/activity/activity.ts:41


usage

Protected Readonly usage: ActivityUsageInfo

Current resource usage vector information

Defined in

src/activity/activity.ts:42

Accessors

provider

get provider(): ProviderInfo

Returns

ProviderInfo

Defined in

src/activity/activity.ts:45

Methods

getState

getState(): ActivityStateEnum

Returns

ActivityStateEnum

Defined in

src/activity/activity.ts:49


getPreviousState

getPreviousState(): ActivityStateEnum

Returns

ActivityStateEnum

Defined in

src/activity/activity.ts:53

Was this helpful?