mindsphere / mindconnect-nodejs

NodeJS Library for Industrial IoT Connectivity - TypeScript SDK for Industrial IoT - Command Line Interface - Development Proxy - typescript-sdk is waiting for your contributions!
https://developer.siemens.com/industrial-iot-open-source/index.html
MIT License
68 stars 23 forks source link

feat: add object metadata methods to the DataLakeClient in MindSphere SDK #199

Closed sn0wcat closed 3 years ago

sn0wcat commented 4 years ago

if you have never contributed to open source here is your chance: ๐Ÿ˜ธ

(If you don't have MindSphere access, you can get a free account by registering at https://siemens.mindsphere.io/en/start )

[0] Comment on this issue that you will take care of this feature impementation ;) [1] fork the repository (click on the Fork button) [2] Clone it to your local system and install the dependencies by running npm install in the cloned directory. (you will need nodejs in your development environment) [3] Implement the feature

Navigate to https://developer.mindsphere.io/apis/iot-integrated-data-lake/api-integrated-data-lake-api-swagger-v3-3-0-eu1.html to take a look at Object Metadata operations and the documentation

image

in the src/api/sdk/data-lake.ts

implement the PutObjectMetadata and GetObjectMetadata methods by applying the same principles like for other methods in the file:

Here is how the signature for the GetObjectMetadata method should look like

public async GetObjectMetaData(
        path: string,
        optional?: { subtenantid?: string }
    ): Promise<DataLakeModels.ObjectMetaDataResponse> {
        // call await this.HttpAction  with correct verb and baseUrl
        // return result casted to the result type (get the correct type from documentation, all necessary typescript interfaces are already available in DataLakeModels namespace
    }

Add documentation to the 2 methods by creating a comment above and copy/pasting the documentation from the web page. (see examples in the same file)

You are done. ๐ŸŽ‰ ๐ŸŽถ ๐Ÿ˜ธ ๐Ÿ‘

[4] Push the changes back to your repository [5] Click the Compare & pull request button. [6] Click Create pull request to open a new pull request.

See also:

https://opensource.com/article/19/7/create-pull-request-github

Happy Hacktoberfest!

https://hacktoberfest.digitalocean.com/

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.99. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

amarisch commented 4 years ago

I'll take a stab at this.

sn0wcat commented 4 years ago

@amarisch sure go ahead :)

sn0wcat commented 4 years ago

@amarisch do you need some help with the issue? hacktoberfest is almost over :)

amarisch commented 4 years ago

@amarisch do you need some help with the issue? hacktoberfest is almost over :)

I apologize! I tried to play with mindconnect but coudn't get application credential/authorization to work, and then got carried away by other projects...

So I did: "mc service-credentials" to set up credentials for cli. But when I tried "mc list-assets", it gave me,

Network error occured Unauthorized {"status":null,"errorMessage":null,"message":null,"customCode":"KMUL01","errorCode":null,"logRef":"5f9bda2e0faf1d762f21b514a1622a3f","displayMessage":"Bad Credentials","exceptionStackTrace":null}

And when I ran npm test, I received this message: "Error: You have to pass the basic authentication header (Basic: in the constructor. Wrong Passkey in CLI?" I believe it's also related to authentication?

Are the issues only open to the public in October?

sn0wcat commented 4 years ago

@amarisch No worries, the issues are open to the public also after October, I just thought that you want to get your hacktoberfest points ๐Ÿ˜บ . If you are having problems with authorization, delete the credentials in both CLI and the mindsphere and recreate them, you have to have exact configuration like in your developer cockpit .

Btw, I updated the CONTRIBUTING.md so that it provides a bit more infos and there is a video online too to help with setting up the CLI.

https://opensource.mindsphere.io/docs/mindconnect-nodejs/cli/setting-up-the-cli.html#tab1anchor3