Class List Method List File List

# Class: Com::Vmware::Vapi::Metadata::Metamodel::Source

Inherits:
  VAPI::Bindings::VapiService
  - Object
  - VAPI::Bindings::VapiService
  - Com::Vmware::Vapi::Metadata::Metamodel::Source
  show all
Defined in:
  /build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata/metamodel.rb

## Overview

The ``Com::Vmware::Vapi::Metadata::Metamodel::Source`` class provides methods to manage the sources of metamodel metadata information.

     The interface definition language infrastructure provides tools to generate various kinds of metadata in JSON format from the interface definition files and additional properties files. One of the generated files contains metamodel information. The generated file can be registered as a source of metadata.

     The metamodel file contains all the data present in the interface definition files. Each metamodel file contains data about one component element. When a metamodel file is added as a source, each source contributes only one component element's metadata.

     Metamodel metadata can also be discovered from a remote server that supports the metamodel metadata  classs  (see   :mod:`com.vmware.vapi.metadata.metamodel`  ). Since multiple components can be registered with a single metadata server, when a remote server is registered as a source, that source can contribute more than one component.

## Defined Under Namespace

Classes: CreateSpec, Info

## Constant Summary

RESOURCE_TYPE =

      'com.vmware.vapi.metadata.metamodel.source'

## Instance Method Summary (collapse)

- - (Void) create(source_id, spec)

  Creates a new metadata source.

- - (Void) delete(source_id)

  Deletes an existing metamodel metadata source from the infrastructure.

- - (String) fingerprint(source_id = nil)

  Returns the aggregate fingerprint of metadata from all the metadata sources or from a particular metadata source if ``source_id`` is specified.

- - (Com::Vmware::Vapi::Metadata::Metamodel::Source::Info) get(source_id)

  Retrieves information about the metadata source corresponding to ``source_id`` .

- - (Source) initialize(config) constructor

  Constructs a new instance.

- - (Array<String>) list

  Returns the identifiers of the metadata sources currently registered with the infrastructure.

- - (Void) reload(source_id = nil)

  Reloads the metamodel metadata from all the metadata sources or of a particular metadata source if ``source_id`` is specified.

## Constructor Details

### - (`Source`) initialize(config)

Constructs a new instance.

Parameters:

- config (`VAPI::Bindings::StubConfig`) —

  A hash with the api provider details.

    562
    563
    564
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata/metamodel.rb', line 562

    def initialize(config)
        super(config, @@service_info)
    end

## Instance Method Details

### - (`Void`) create(source_id, spec)

Creates a new metadata source. Once the server validates the registration information of the metadata source, the metamodel metadata is retrieved from the source. This populates elements in all the classs defined in :mod:`com.vmware.vapi.metadata.metamodel` package .

Parameters:

- source_id (`String`) —

  metadata source identifier.

- spec (`Com::Vmware::Vapi::Metadata::Metamodel::Source::CreateSpec`) —

  create specification.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::AlreadyExists`) —

  if the metadata source identifier is already registered with the infrastructure.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if the type of the source specified in null is invalid.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if the file specified in null is not a valid JSON file or if the format of the metamodel metadata in the JSON file is invalid.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if the URI specified in null is unreachable or if there is a transport protocol or message protocol mismatch between the client and the server or if the remote server do not have classs present in :mod:`com.vmware.vapi.metadata.metamodel` package .

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the file specified in null does not exist.

    586
    587
    588
    589
    590
    591
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata/metamodel.rb', line 586

    def create(source_id, spec)
        invoke_with_info(@@create_info, {
            'source_id' => source_id,
            'spec' => spec,
        })
    end

### - (`Void`) delete(source_id)

Deletes an existing metamodel metadata source from the infrastructure.

Parameters:

- source_id (`String`) —

  Identifier of the metadata source.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the metadata source associated with ``source_id`` is not found.

    601
    602
    603
    604
    605
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata/metamodel.rb', line 601

    def delete(source_id)
        invoke_with_info(@@delete_info, {
            'source_id' => source_id,
        })
    end

### - (`String`) fingerprint(source_id = nil)

Returns the aggregate fingerprint of metadata from all the metadata sources or from a particular metadata source if ``source_id`` is specified.

Parameters:

- source_id (`String`, `nil`) (defaults to: `nil`) —

  Identifier of the metadata source. If unspecified, the fingerprint of all the metadata sources is returned.

Returns:

- (`String`) —

  Aggregate fingerprint of all the metadata sources or of a particular metadata source.

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the metadata source associated with ``source_id`` is not found.

    656
    657
    658
    659
    660
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata/metamodel.rb', line 656

    def fingerprint(source_id=nil)
        invoke_with_info(@@fingerprint_info, {
            'source_id' => source_id,
        })
    end

### - (`Com::Vmware::Vapi::Metadata::Metamodel::Source::Info`) get(source_id)

Retrieves information about the metadata source corresponding to ``source_id`` .

Parameters:

- source_id (`String`) —

  Identifier of the metadata source.

Returns:

- (`Com::Vmware::Vapi::Metadata::Metamodel::Source::Info`) —

  The :class:`Com::Vmware::Vapi::Metadata::Metamodel::Source::Info` instance that corresponds to ``source_id``

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the metadata source associated with ``source_id`` is not found.

    616
    617
    618
    619
    620
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata/metamodel.rb', line 616

    def get(source_id)
        invoke_with_info(@@get_info, {
            'source_id' => source_id,
        })
    end

### - (`Array<String>`) list

Returns the identifiers of the metadata sources currently registered with the infrastructure.

Returns:

- (`Array<String>`) —

  The list of identifiers for metadata sources currently registered.

    627
    628
    629
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata/metamodel.rb', line 627

    def list()
        invoke_with_info(@@list_info)
    end

### - (`Void`) reload(source_id = nil)

Reloads the metamodel metadata from all the metadata sources or of a particular metadata source if ``source_id`` is specified.

Parameters:

- source_id (`String`, `nil`) (defaults to: `nil`) —

  Identifier of the metadata source. If unspecified, all the metadata sources are reloaded.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the metadata source associated with ``source_id`` is not found.

    640
    641
    642
    643
    644
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata/metamodel.rb', line 640

    def reload(source_id=nil)
        invoke_with_info(@@reload_info, {
            'source_id' => source_id,
        })
    end