Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of Blocks from Sample Repositories shows blocks that are already deployed #5

Closed
sagIoTPower opened this issue Dec 1, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@sagIoTPower
Copy link
Collaborator

If a community block is already deployed as an extension. It should be removed or disabled form the list.
This is to prevent deploying a block twice.

Screenshot 2023-12-01 at 10 21 41
@sagIoTPower sagIoTPower added the enhancement New feature or request label Dec 1, 2023
@sagIoTPower
Copy link
Collaborator Author

This requires to match two kind of metadata information:

  1. blocks loaded in the streaming analytics engine
  2. blocks retrieved from github repositories

The metadata for blocks from 1. are in the form:

{
    "consumesInput": true,
    "id": "apama.analyticsbuilder.blocks.PositionInput",
    "inputs": [],
    "parameters": [
        {
            "semanticType": "c8y_deviceOrGroupId",
            "id": "deviceId",
            "name": "Input Source",
            "type": "any",
            "description": "Defines the device or group of devices from which the position is received.",
            "extendedDescription": "This can be a single device, or an object that references or contains a group of devices."
        },
  ]
} 

The metadata for blocks from 2. are in the form:

{
    "name": "CreateEvent.mon",
    "path": "samples/blocks/CreateEvent.mon",
    "sha": "8b5c00f296baffbafb03a70d3444b47e85ddf133",
    "size": 6139,
    "url": "https://api.github.com/repos/SoftwareAG/apama-analytics-builder-block-sdk/contents/samples/blocks/CreateEvent.mon?ref=rel/10.18.0.x",
    "html_url": "https://github.com/SoftwareAG/apama-analytics-builder-block-sdk/blob/rel/10.18.0.x/samples/blocks/CreateEvent.mon",
    "git_url": "https://api.github.com/repos/SoftwareAG/apama-analytics-builder-block-sdk/git/blobs/8b5c00f296baffbafb03a70d3444b47e85ddf133",
    "download_url": "https://raw.githubusercontent.com/SoftwareAG/apama-analytics-builder-block-sdk/rel/10.18.0.x/samples/blocks/CreateEvent.mon",
    "type": "file",
    "_links": {
      "self": "https://api.github.com/repos/SoftwareAG/apama-analytics-builder-block-sdk/contents/samples/blocks/CreateEvent.mon?ref=rel/10.18.0.x",
      "git": "https://api.github.com/repos/SoftwareAG/apama-analytics-builder-block-sdk/git/blobs/8b5c00f296baffbafb03a70d3444b47e85ddf133",
      "html": "https://github.com/SoftwareAG/apama-analytics-builder-block-sdk/blob/rel/10.18.0.x/samples/blocks/CreateEvent.mon"
    }
}

In order to get the complete block name (monitor) one has to parse the content of the EPL from github.

@sagIoTPower sagIoTPower changed the title List of Blocks from Smaple Repsoitories shows blocks that are already deployed List of Blocks from Sample Repositories shows blocks that are already deployed Dec 1, 2023
@sagIoTPower
Copy link
Collaborator Author

This feature is added to the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant