skuid CLI - skuid pull

  • 1
  • Question
  • Updated 12 months ago
  • Answered
How to skuid-pull a specific page?

According to the CLI documentation:

Data management:

  • --dir: (string) The input/output directory where files are retrieved and stored to ordeployed from.
    • Abbreviated form: -d
  • --module: (string) Skuid on Salesforce only. One or more Skuid page modules, separated by commas, to deploy or retrieve.
    • Abbreviated form: -m
  • --page: (string) Skuid on Salesforce only. One or more Skuid pages, listed by page name and separated by commas, to retrieve to the local file system.
    • Abbreviated form: -n

Could you provide an example command to pull a specific page? I tried
--module Download --page Download-TestContact

This works: TestContact is the only page in this module.

--module Download

Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb

Posted 1 year ago

  • 1
Photo of Matthew Leahy

Matthew Leahy, Employee

  • 742 Points 500 badge 2x thumb
Hello,

Try the following to pull a single page:

skuid pull --host https://<Domain>.my.salesforce.com -n <PageName> -v

Let me know your results.

Thanks,
Matt
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb
// test is placeholder; TestContact is the page name

// TestContact  has module = Download
// this command fails:
skuid_windows_amd64.exe pull -n Download_TestContact -v --host https://test.cs17.my.salesforce.com --password test –-username test@heidrick.com.test --client-id test --client-secret test


"{\"error\":\"You must provide a \\\"module\\\" URL Parameter containing the nam
e, or comma-separated names, of the Modules of pages you would like to retrieve\
"}"
json: cannot unmarshal string into Go value of type types.PullResponse



// this command works: 
skuid_windows_amd64.exe pull -m Download --host https://test.cs17.my.salesforce.com --password test –-username test@heidrick.com.test --client-id test --client-secret test

Download_TestContact can be successfully downloaded.


// this command also works: I think because there is only 1 page with module = Download. 
skuid_windows_amd64.exe pull -m Download -n Download_TestContact -v --host https://test.cs17.my.salesforce.com --password test --username test@heidrick.com.test --client-id test --client-secret test


// update module for page TestContact = Available. all of our pages are in this Module Available

// this command fails: there are a lot of pages with module = Available. 
skuid_windows_amd64.exe pull -m Available -n Available_TestContact -v --host https://test.cs17.my.salesforce.com --password test –-username test@heidrick.com.test --client-id test --client-secret test


[{"errorCode":"APEX_ERROR","message":"System.LimitException: Apex heap size too
large: 8450666\n\nExternal entry point\n(skuid)\n\n"}]
unexpected end of JSON input


The apex heap size issue makes sense when you try to pull multiple pages because our pages are huge. But -n flag should only pull TestContact page which fits under the heap size since I can pull it by just using another Module = Download when it's the only page under that module. 

As you can see, the module appears a required flag for the pull. Once I supply that module, it appears pull all pages with that module and ignores the -n flag.

Thanks for your help on this!!





(Edited)
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb
// Update another page with module = Download. 
skuid_windows_amd64.exe pull -m Download -n Download_TestContact -v --host https://test.cs17.my.salesforce.com --password test --username test@heidrick.com.test --client-id test --client-secret test

2 pages are downloaded. -n seems to be ignored.
Photo of Matthew Leahy

Matthew Leahy, Employee

  • 742 Points 500 badge 2x thumb
Thanks for your feedback. I'll spend some more time testing, but downloading a module, or single page, is working on my end. The "Apex Heap Size" is a known issue that will be resolved in a later release.
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb

Hi you were able to download a single page using the -n flag  without the -m flag?

As you can see, -m flag is required for the pull. When both -m and -n are provided, the CLI is ignoring the -n flag.

Can you post the exact command and your set up? Anything different from the instructions in the skuid CLI documentation? Or anything I'm doing incorrectly above?

Can you try downloading a specific page when there are multiple pages with that same module?

Thanks!
Photo of Matthew Leahy

Matthew Leahy, Employee

  • 742 Points 500 badge 2x thumb
I used the following:

skuid pull --host https://<Domain>.my.salesforce.com -n <PageName> -v

I set environment variables in my profile (.bash_profile):

export SKUID_UN=<UserName>
export SKUID_PW=<Passeord>
export SKUID_CLIENT_ID=<ClientID>
export SKUID_CLIENT_SECRET=<ClientSecret>

FYI: I renamed skuid_windows_amd64.exe to skuid

Let me know how it goes. I'll test with all options on command line. 

Thanks,
Matt
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb
Thanks for the reply!

I switched to my mac machine and tried the following:

export SKUID_UN=<UserName>
export SKUID_PW=<Passeord>
export SKUID_CLIENT_ID=<ClientID>
export SKUID_CLIENT_SECRET=<ClientSecret>


I also renamed skuid_windows_amd64.exe to skuid

This command works:

skuid pull -m Download --host https://hsi--devpro01.cs17.my.salesforce.com


This failed:
skuid pull -n Download_TestContact --host https://hsi--devpro01.cs17.my.salesforce.com

"{\"error\":\"You must provide a \\\"module\\\" URL Parameter containing the name, or comma-separated names, of the Modules of pages you would like to retrieve\"}"
json: cannot unmarshal string into Go value of type types.PullResponse

Photo of Matthew Leahy

Matthew Leahy, Employee

  • 742 Points 500 badge 2x thumb
Just noticed there is an update to release 0.3.0. I am using 0.2.3. I'll test with 0.3.0.
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb
I just noticed that the release was just from about a week ago. Good catch!
Photo of Matthew Leahy

Matthew Leahy, Employee

  • 742 Points 500 badge 2x thumb
Ok, I upgraded to skuid CLI 0.3.0 and it is still working for both -m and -n.

Here's the full command line string I'm using:

skuid pull --host https://skuid-demo.my.salesforce.com -u <UserName> -p <Password+Token> --client-id <ClientID> --client-secret <ClientSecret> -n <PageName> -v
or
skuid pull --host https://skuid-demo.my.salesforce.com -u <UserName> -p <Password+Token> --client-id <ClientID> --client-secret <ClientSecret> -m <ModuleName> -v

Go ahead and add an issue in Github for the project, "https://github.com/skuid/skuid".

Thanks,
Matt
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb
I'm still getting the same error. For PageName, did you use module_pagename? Is it possible for Skuid to investigate why this message comes up:

"{\"error\":\"You must provide a \\\"module\\\" URL Parameter containing the name, or comma-separated names, of the Modules of pages you would like to retrieve\"}"
json: cannot unmarshal string into Go value of type types.PullResponse

Photo of Matthew Leahy

Matthew Leahy, Employee

  • 742 Points 500 badge 2x thumb
It works with page name by itself as well as with module with page name. What is your module and page name (-m Download -n Download_TestContact)? I still recommend adding an issue in the Github project.
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb
The page name is TestContact. Module is Download.
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb
Issue added to the github project.
Photo of Zach McElrath

Zach McElrath, Employee

  • 53,420 Points 50k badge 2x thumb
Jill, what Skuid release do you have installed in your org? The ability to pull specific pages by name may not be available in the release of Skuid that is in your org. 
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb
We are still on Rockaway. The skuid REST API in Rockaway does not support the new -n flag?
Photo of J.

J., Official Rep

  • 7,846 Points 5k badge 2x thumb
That is correct. The single page functionality was added in Millau (11.2.0). Your Salesforce instance will need to be updated to at least this version of Skuid in order for this functionality to work.
(Edited)
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb
Thanks very much! We are going for the Millau upgrade soon!
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,042 Points 2k badge 2x thumb
CLI is working correctly against Millau.

I'm also evaluating https://github.com/skuid/skuid-grunt

  • options.page: [String or Array| Required] The Page(s) you want to pull down (Requires Skuid Version 11.2 or higher).

I tried this again a Millau 11.2.8. It is still querying against the module name in the API calls to Salesforce and downloading the page with empty module name.
  var millauOptions = {
    'clientId': '',
    'clientSecret': '',
    'username': '',
    'password': '',
  'nforceOptions': {
      'environment': 'sandbox',
    'loginUri': 'test.salesforce.com'
}
  };

    'skuid-pull':{
      'options': millauOptions,
      'devpro01':{
        'options':{
          'dest': 'skuidpages/',
          'page':['SFHeaderContactDetail'],
        }
      }
    }
Is options.page supported in the grunt version as the documentation says?
(Edited)