Skip to main content

Image

An Image model represents a Docker image, to either build, or run, your services. Images belong to an Account: an image is used only inside the account it sits in, and is linked to each of its regions it is published into.

@example
const image = new Image('nginx', '2.4');
account.addImage(image);
@group

Models/Image

@see

Definition of Default Models.

Hierarchy

Index

Constructors

constructor

  • Image(imageFamily: string, imageName: string): Image
  • Parameters

    • imageFamily: string

      The repository name shared by all versions of this image.

    • imageName: string

      The version or tag of this image within its family.

    Returns Image

Properties

readonlyinheritedanchors

anchors: (MatchingAnchor<BaseAnchorSchema> | UnknownAnchor)[] = []

The anchors attached to this model, whether declared on it or borrowed from another model.

readonlyimageFamily

imageFamily: string

readonlyimageId

imageId: string

readonlyimageName

imageName: string

staticreadonlyinheritedNODE_NAME

NODE_NAME: string

The name of the node. All nodes with same name are of the same category.

staticreadonlyinheritedNODE_PACKAGE

NODE_PACKAGE: string

The package of the node.

staticreadonlyinheritedNODE_SCHEMA

NODE_SCHEMA: unknown

The schema of the node.

staticreadonlyinheritedNODE_TYPE

NODE_TYPE: NodeType

The type of the node.

Methods

inheritedaddAnchor

  • To attach an AAnchor to this model. An anchor is only added once - re-adding the same anchor, identified by its ID and parent, throws.


    Parameters

    Returns void

inheritedgetAnchor

  • getAnchor(anchorId: string, parent?: UnknownModel): UnknownAnchor | undefined
  • To get an attached anchor by its ID.


    Parameters

    • anchorId: string

      The ID of the anchor.

    • optionalparent: UnknownModel

      The model that declared the anchor. Defaults to self.

    Returns UnknownAnchor | undefined

inheritedgetAnchorIndex

  • getAnchorIndex(anchorId: string, parent?: UnknownModel): number
  • The position of an attached anchor in AModel.anchors, or -1 when it is not attached.


    Parameters

    • anchorId: string

      The ID of the anchor.

    • optionalparent: UnknownModel

      The model that declared the anchor. Defaults to self.

    Returns number

inheritedgetAnchors

  • To get all attached anchors, narrowed by anchor class and/or by the value of their properties.


    Parameters

    • filters: { key: string; value: unknown }[] = []

      Each filter is a property key the anchor must carry with the given value.

    • types: Constructable<MatchingAnchor<BaseAnchorSchema> | UnknownAnchor>[] = []

      The anchor classes to keep. An empty list keeps every class.

    Returns UnknownAnchor[]

inheritedgetAnchorsMatchingSchema

  • getAnchorsMatchingSchema<S>(from: Constructable<S>, propertyFilters?: ObjectKeyValue<S[properties]>[], options?: { searchBoundaryMembers?: boolean }): Promise<MatchingAnchor<S>[]>
  • To find anchors by their schema rather than by their class.

    This is how a module consumes what another module produced without importing its classes - you match on the shape you need, and any anchor satisfying that shape is returned. Anchors that do not satisfy the schema are skipped, not reported as errors.

    @see

    Definition of Anchors.


    Type parameters

    Parameters

    • from: Constructable<S>

      The anchor schema to match against.

    • propertyFilters: ObjectKeyValue<S[properties]>[] = []

      Each filter is a property key the anchor must carry with the given value.

    • options: { searchBoundaryMembers?: boolean } = {}

      searchBoundaryMembers searches the whole boundary this model belongs to. Set it to false to search only this model.

      • optionalsearchBoundaryMembers: boolean = true

    Returns Promise<MatchingAnchor<S>[]>

inheritedgetModelsMatchingSchema

  • getModelsMatchingSchema<S>(schema: Constructable<S>, filters?: ObjectKeyValue<S>[], options?: { searchBoundaryMembers?: boolean }): Promise<MatchingModel<S>[]>
  • To find models by their schema. See AModel.getAnchorsMatchingSchema.


    Type parameters

    • S: object

    Parameters

    • schema: Constructable<S>

      The model schema to match against.

    • filters: ObjectKeyValue<S>[] = []

      Each filter is a schema key the model must carry with the given value.

    • options: { searchBoundaryMembers?: boolean } = {}

      searchBoundaryMembers searches the whole boundary this model belongs to. Set it to false to search only this model.

      • optionalsearchBoundaryMembers: boolean = true

    Returns Promise<MatchingModel<S>[]>

inheritedgetOverlaysMatchingSchema

  • getOverlaysMatchingSchema<S>(schema: Constructable<S>, propertyFilters?: ObjectKeyValue<S[properties]>[], options?: { searchBoundaryMembers?: boolean }): Promise<MatchingModel<S>[]>
  • To find overlays by their schema. See AModel.getAnchorsMatchingSchema.


    Type parameters

    Parameters

    • schema: Constructable<S>

      The overlay schema to match against.

    • propertyFilters: ObjectKeyValue<S[properties]>[] = []

      Each filter is a property key the overlay must carry with the given value.

    • options: { searchBoundaryMembers?: boolean } = {}

      searchBoundaryMembers searches the whole boundary this model belongs to. Set it to false to search only this model.

      • optionalsearchBoundaryMembers: boolean = true

    Returns Promise<MatchingModel<S>[]>

inheritedgetResourcesMatchingSchema

  • getResourcesMatchingSchema<S>(schema: Constructable<S>, propertyFilters?: ObjectKeyValue<S[properties]>[], responseFilters?: ObjectKeyValue<S[response]>[], options?: { searchBoundaryMembers?: boolean }): Promise<MatchingResource<S>[]>
  • To find resources by their schema. See AModel.getAnchorsMatchingSchema.

    Only resources produced by the modules that own the searched models are considered, so this returns another module's resources rather than every resource in the run.


    Type parameters

    Parameters

    • schema: Constructable<S>

      The resource schema to match against.

    • propertyFilters: ObjectKeyValue<S[properties]>[] = []

      Each filter is a property key the resource must carry with the given value.

    • responseFilters: ObjectKeyValue<S[response]>[] = []

      Each filter is a response key the resource must carry with the given value.

    • options: { searchBoundaryMembers?: boolean } = {}

      searchBoundaryMembers searches the whole boundary this model belongs to. Set it to false to search only this model.

      • optionalsearchBoundaryMembers: boolean = true

    Returns Promise<MatchingResource<S>[]>

inheritedremoveAllAnchors

  • removeAllAnchors(): void
  • To detach every anchor from this model.


    Returns void

inheritedremoveAnchor

  • To detach an anchor from this model. Detaching an anchor that is not attached is a no-op.


    Parameters

    Returns void