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

Login-Credentials #1

Open
RobinDev03 opened this issue Dec 2, 2021 · 4 comments
Open

Login-Credentials #1

RobinDev03 opened this issue Dec 2, 2021 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@RobinDev03
Copy link

Hey, where do I have to fill in my credentials to use the package?

@denny0754
Copy link
Owner

denny0754 commented Dec 2, 2021

Hi @RobinDev03,
to fill your Proxmox's credentials you call the module like this:

const pveapi = require('pve-api')({uname}, {pwd}, {realm}, {host}, {verboseLevel});

Where uname is the username to which you have access, pwd is the password, realm is the realm used by your used(PAM or PVE Authentication, LDAP, AD or OpenID), host is the hostname or IPv4 of the server(port 8006 is not needed) and finally verboseLevel which is the level of verbosity, default being 0 which only outputs errors and critical messages.
You should then be able to access all functions.

I just noticed that I didn't put the arguments of my module in the ReadMe. I'll update it right away.

Let me know if you need help of any sort 👍🏿.
Thanks,

Diego Vaccher.

@denny0754 denny0754 self-assigned this Dec 2, 2021
@denny0754 denny0754 added the documentation Improvements or additions to documentation label Dec 2, 2021
@RobinDev03
Copy link
Author

Hey,

thank you.

Do you have a Discord-Server for Questions containing this package?

@RobinDev03
Copy link
Author

When I use this:

const username = client.config.hostData.username;
const password = client.config.hostData.password;
const realm = client.config.hostData.realm;
const host = client.config.hostData.host;
const pve_api = require('pve-api')({username}, {password}, {realm}, {host});

I get this error:

home/robin/WebstormProjects/dsc-PVE/node_modules/pve-api/lib/pve-api.js:609
                                await _GenerateNewTicket();
                                ^^^^^

SyntaxError: await is only valid in async functions and the top level bodies of modules
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/robin/WebstormProjects/dsc-PVE/pve.js:21:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)

@denny0754
Copy link
Owner

Hey @RobinDev03,

At the moment my API isn't fully implemented and many function were just defined as normal function (without the async keyword) because the structure and functionality of the API was thought differently from what it will be.
However, I'll update it right as I got some time in my hand.
Anyhow, feel free to make a pull request, it would be great!

As of the Discord-Server, right now I don't have one, but I'm planning to create one!

Thanks,

Diego Vaccher.

Repository owner locked as resolved and limited conversation to collaborators Jan 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants