Skip to content

Latest commit

 

History

History
183 lines (104 loc) · 4.12 KB

props_inf.vmrequest.md

File metadata and controls

183 lines (104 loc) · 4.12 KB

Class: VmRequest

yajsapi / Exports / props/inf / VmRequest

Class: VmRequest

props/inf.VmRequest

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new VmRequest(package_url, package_format)

Parameters

Name Type
package_url string
package_format VmPackageFormat

Overrides

ExeUnitRequest.constructor

Defined in

yajsapi/props/inf.ts:71

Properties

package_format

package_format: Field

Defined in

yajsapi/props/inf.ts:69

package_url

package_url: Field

Inherited from

ExeUnitRequest.package_url

Defined in

yajsapi/props/inf.ts:54

Methods

_custom_mapping

_custom_mapping(props, data): void

Parameters

Name Type
props object
data object

Returns

void

Inherited from

ExeUnitRequest._custom_mapping

Defined in

yajsapi/props/base.ts:111

fields

fields(cls): Field[]

Parameters

Name Type
cls any

Returns

Field[]

Inherited from

ExeUnitRequest.fields

Defined in

yajsapi/props/base.ts:113

from_properties

from_properties(props): any

Initialize the model from an object representation.

description When provided with an object of properties, it will find the matching keys within it and fill the model fields with the values from the object.

It ignores non-matching keys - i.e. doesn't require filtering of the properties' object before the model is fed with the data. Thus, several models can be initialized from the same object and all models will only load their own data.

Parameters

Name Type
props object

Returns

any

Inherited from

ExeUnitRequest.from_properties

Defined in

yajsapi/props/base.ts:137

keys

keys(): any

example

import { props } from "yajsapi"
const { Field, Model } = props;
export class NodeInfo extends Model {
  name: Field = new Field({ metadata: { key: "golem.node.id.name" } });
  subnet_tag: Field = new Field({
    metadata: { key: "golem.node.debug.subnet" },
  });
}
new NodeInfo().keys().name()
// Output: 'golem.node.id.name'

Returns

any

a mapping between the model's field names and the property keys

Inherited from

ExeUnitRequest.keys

Defined in

yajsapi/props/base.ts:182