Giter Site home page Giter Site logo

Comments (14)

franklupo avatar franklupo commented on June 7, 2024

Hi,
when call a method tre result is a class Result. See result detail.
You can also use specific methods instead of using url

   //use url
   var vm = client.get("/nodes/pve1/qemu/100");

   //use methods
    var vm = client.Nodes["pve1"].Qemu[100];

You are welcome

from cv4pve-api-dotnet.

Snakzi avatar Snakzi commented on June 7, 2024

Hey,

thank you for your response. If I do this:

var users = client.Get("/access/users");
MessageBox.Show(users.Response);

I just get an error:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: "The best match for the overloaded System.Windows.Forms.MessageBox.Show(string) method contains some invalid arguments."

from cv4pve-api-dotnet.

franklupo avatar franklupo commented on June 7, 2024
var users = client.Get("/access/users");
MessageBox.Show(users.Response.data);

from cv4pve-api-dotnet.

Snakzi avatar Snakzi commented on June 7, 2024

This will also print out the same error. Do I need to somehow activate the API on the proxmox node first?
Sorry, very beginner with proxmox api here.

from cv4pve-api-dotnet.

franklupo avatar franklupo commented on June 7, 2024

Hi,
what version do you use dotnet?

from cv4pve-api-dotnet.

Snakzi avatar Snakzi commented on June 7, 2024

core 3.1 and framework 4.7.2

from cv4pve-api-dotnet.

franklupo avatar franklupo commented on June 7, 2024

Hi,

        static void Main(string[] args)
        {
            var client = new PveClient("10.92.90.101");
            if (client.Login("root", "password"))
            {
                var users = client.Access.Users.Index();
                Console.Out.WriteLine(users.Response.data);

                users = client.Get("/access/users");
                Console.Out.WriteLine(users.Response.data);
            }
        }

it works for me.

from cv4pve-api-dotnet.

Snakzi avatar Snakzi commented on June 7, 2024

Hello,

that is very weird. First option does not work for me as well. Do I have to enable something on Proxmox itself first? Or choose the authentication method?

In a console, the printOut is: System.Collections.Generic.List`1[System.Object]

from cv4pve-api-dotnet.

franklupo avatar franklupo commented on June 7, 2024

The user is @pam or @pve.
The data is dynamic objec in this case a collection

from cv4pve-api-dotnet.

Snakzi avatar Snakzi commented on June 7, 2024

Okay, thank you. How would I create a user?
client.Access.Users.CreateUser("test", "", "", true, 0, "", "", "", "", "test1234");
is not printing out any error but it does not create an user either.

from cv4pve-api-dotnet.

franklupo avatar franklupo commented on June 7, 2024

In result the message error?

from cv4pve-api-dotnet.

Snakzi avatar Snakzi commented on June 7, 2024

There is no error. MessageBox is just blank

from cv4pve-api-dotnet.

Snakzi avatar Snakzi commented on June 7, 2024

I found it now. I was just too dumb to properly read the ExpandoObject.

However, I have a question about Permissions. If I want to assign a permission to someone, there is no parameter to choose the role I want to apply to the user.

from cv4pve-api-dotnet.

Snakzi avatar Snakzi commented on June 7, 2024

This is solved. Thank you for your patience and help!

from cv4pve-api-dotnet.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.