Giter Club home page Giter Club logo

Comments (5)

kevinmccarthy avatar kevinmccarthy commented on July 19, 2024

User error. :) dataStorePath is invalid -- needed to be datastorePath

from vsphere-connect.

kevinmccarthy avatar kevinmccarthy commented on July 19, 2024

I am not able to specify the enumerated /dynamic types. For instance:
https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.host.DatastoreBrowser.Query.html

the FileFolderQuery is simply a marker (has no attributes or members), but I method.js does not seen to be able to map 'FileFolderQuery', ['FileFolderQuery'], or { FileFolderQuery: null } into that dynamic type definition.

Is there any way to specify this using a typing function?

from vsphere-connect.

kevinmccarthy avatar kevinmccarthy commented on July 19, 2024

This also does not work:

const spec = {
    query: vconnect.util.sType('FolderFileQuery'),
    details: {
        fileOwner: false,
        fileSize: true,
        fileType:  false,
        modification: true
    }
};

I noticed the type is defined in the vsphere-schema instance, but still don't see any docs on how to resolve it.

"FolderFileQuery": {
    "type": "FolderFileQuery",
    "inherits": "FileQuery"
  },

from vsphere-connect.

bhoriuchi avatar bhoriuchi commented on July 19, 2024

It looks like you are using the v1 code which is no longer in development. In the v2 code which is currently in development you can accomplish this similar to https://github.com/bhoriuchi/vsphere-connect/blob/master/src/spec/VirtualMachine.js#L163 . The v2 api is documented http://bhoriuchi.github.io/vsphere-connect/#/api

If you absolutely need to use the v1 code which uses the node-soap library you can specify an attributes property with the xsi type like here https://github.com/bhoriuchi/vsphere-connect/blob/v1/lib/specUtil.js#L18-L20

from vsphere-connect.

kevinmccarthy avatar kevinmccarthy commented on July 19, 2024

This seems to work:

const spec = {
    details: {
        fileOwner: false,
        fileSize: true,
        fileType:  false,
        modification: true
    },
    query: {
        attributes: {
            'xsi:type': 'FolderFileQuery'
        }
    }
};

Thanks! I will upgrade to v2 shortly, but the v1 fix is super helpful!

Regards,
Kevin

from vsphere-connect.

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.