Using landscape from command line











up vote
0
down vote

favorite












Is there any doc for managing landscape using the command line? For example, how can I test a ping from my client machine?










share|improve this question
























  • is there anyone who can answer? or no one uses landscape as CM tool?
    – zainsyed
    Oct 6 at 0:20















up vote
0
down vote

favorite












Is there any doc for managing landscape using the command line? For example, how can I test a ping from my client machine?










share|improve this question
























  • is there anyone who can answer? or no one uses landscape as CM tool?
    – zainsyed
    Oct 6 at 0:20













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Is there any doc for managing landscape using the command line? For example, how can I test a ping from my client machine?










share|improve this question















Is there any doc for managing landscape using the command line? For example, how can I test a ping from my client machine?







landscape






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 5 at 4:42









Henry WH Hack v2.1.2

49751123




49751123










asked Oct 4 at 23:28









zainsyed

13




13












  • is there anyone who can answer? or no one uses landscape as CM tool?
    – zainsyed
    Oct 6 at 0:20


















  • is there anyone who can answer? or no one uses landscape as CM tool?
    – zainsyed
    Oct 6 at 0:20
















is there anyone who can answer? or no one uses landscape as CM tool?
– zainsyed
Oct 6 at 0:20




is there anyone who can answer? or no one uses landscape as CM tool?
– zainsyed
Oct 6 at 0:20










1 Answer
1






active

oldest

votes

















up vote
1
down vote













I believe that what you are asking for is how to manage Landscape server via CLI. Therefore I would like to point you to User Guide located here https://landscape.canonical.com/static/doc/user-guide/
This will be a good start.



With regards to CLI tools you would need to pick which one do you feel most comfortable with/ your preference:
https://landscape.canonical.com/static/doc/api/



And just to get you started there are 3 ways of using this API:



command-line client: easy to use, shell-script friendly



Python module: more powerful, recommended if you want to drive the API via Python



low-level HTTP requests: in the case you want to know what is going on, or write a client for some other language



My personal favourite is the command line client. Once you install landscape-api and source your keys ( you can find, generate and refresh them from Landscape server GUI, just click on your name when you are logged in) as per https://landscape.canonical.com/static/doc/api/api-client-package.html
you can get all the information from your Landscape server and attached machines:



example:



$ landscape-api get-computers | grep host
u'hostname': u'xxx.eu-west-2.compute.amazonaws.com',
u'hostname': u'xxx.eu-west-2.compute.internal',
u'hostname': u'laptop',

$ landscape-api get-computers | grep ping
u'last_ping_time': u'2018-12-05T16:45:39Z',
u'last_ping_time': u'2018-12-05T16:45:39Z',
u'last_ping_time': u'2018-12-05T15:24:20Z',


I am grepping here just to show you example as full output for even 3 machines is quite big especially if you run it with additional switches:



$ landscape-api get-computers --with-hardware


or



$ landscape-api get-computers --with-hardware --json


Then you can additionally parse that with jq for additional text manipulation



Hope this will help.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1081027%2fusing-landscape-from-command-line%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    I believe that what you are asking for is how to manage Landscape server via CLI. Therefore I would like to point you to User Guide located here https://landscape.canonical.com/static/doc/user-guide/
    This will be a good start.



    With regards to CLI tools you would need to pick which one do you feel most comfortable with/ your preference:
    https://landscape.canonical.com/static/doc/api/



    And just to get you started there are 3 ways of using this API:



    command-line client: easy to use, shell-script friendly



    Python module: more powerful, recommended if you want to drive the API via Python



    low-level HTTP requests: in the case you want to know what is going on, or write a client for some other language



    My personal favourite is the command line client. Once you install landscape-api and source your keys ( you can find, generate and refresh them from Landscape server GUI, just click on your name when you are logged in) as per https://landscape.canonical.com/static/doc/api/api-client-package.html
    you can get all the information from your Landscape server and attached machines:



    example:



    $ landscape-api get-computers | grep host
    u'hostname': u'xxx.eu-west-2.compute.amazonaws.com',
    u'hostname': u'xxx.eu-west-2.compute.internal',
    u'hostname': u'laptop',

    $ landscape-api get-computers | grep ping
    u'last_ping_time': u'2018-12-05T16:45:39Z',
    u'last_ping_time': u'2018-12-05T16:45:39Z',
    u'last_ping_time': u'2018-12-05T15:24:20Z',


    I am grepping here just to show you example as full output for even 3 machines is quite big especially if you run it with additional switches:



    $ landscape-api get-computers --with-hardware


    or



    $ landscape-api get-computers --with-hardware --json


    Then you can additionally parse that with jq for additional text manipulation



    Hope this will help.






    share|improve this answer

























      up vote
      1
      down vote













      I believe that what you are asking for is how to manage Landscape server via CLI. Therefore I would like to point you to User Guide located here https://landscape.canonical.com/static/doc/user-guide/
      This will be a good start.



      With regards to CLI tools you would need to pick which one do you feel most comfortable with/ your preference:
      https://landscape.canonical.com/static/doc/api/



      And just to get you started there are 3 ways of using this API:



      command-line client: easy to use, shell-script friendly



      Python module: more powerful, recommended if you want to drive the API via Python



      low-level HTTP requests: in the case you want to know what is going on, or write a client for some other language



      My personal favourite is the command line client. Once you install landscape-api and source your keys ( you can find, generate and refresh them from Landscape server GUI, just click on your name when you are logged in) as per https://landscape.canonical.com/static/doc/api/api-client-package.html
      you can get all the information from your Landscape server and attached machines:



      example:



      $ landscape-api get-computers | grep host
      u'hostname': u'xxx.eu-west-2.compute.amazonaws.com',
      u'hostname': u'xxx.eu-west-2.compute.internal',
      u'hostname': u'laptop',

      $ landscape-api get-computers | grep ping
      u'last_ping_time': u'2018-12-05T16:45:39Z',
      u'last_ping_time': u'2018-12-05T16:45:39Z',
      u'last_ping_time': u'2018-12-05T15:24:20Z',


      I am grepping here just to show you example as full output for even 3 machines is quite big especially if you run it with additional switches:



      $ landscape-api get-computers --with-hardware


      or



      $ landscape-api get-computers --with-hardware --json


      Then you can additionally parse that with jq for additional text manipulation



      Hope this will help.






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        I believe that what you are asking for is how to manage Landscape server via CLI. Therefore I would like to point you to User Guide located here https://landscape.canonical.com/static/doc/user-guide/
        This will be a good start.



        With regards to CLI tools you would need to pick which one do you feel most comfortable with/ your preference:
        https://landscape.canonical.com/static/doc/api/



        And just to get you started there are 3 ways of using this API:



        command-line client: easy to use, shell-script friendly



        Python module: more powerful, recommended if you want to drive the API via Python



        low-level HTTP requests: in the case you want to know what is going on, or write a client for some other language



        My personal favourite is the command line client. Once you install landscape-api and source your keys ( you can find, generate and refresh them from Landscape server GUI, just click on your name when you are logged in) as per https://landscape.canonical.com/static/doc/api/api-client-package.html
        you can get all the information from your Landscape server and attached machines:



        example:



        $ landscape-api get-computers | grep host
        u'hostname': u'xxx.eu-west-2.compute.amazonaws.com',
        u'hostname': u'xxx.eu-west-2.compute.internal',
        u'hostname': u'laptop',

        $ landscape-api get-computers | grep ping
        u'last_ping_time': u'2018-12-05T16:45:39Z',
        u'last_ping_time': u'2018-12-05T16:45:39Z',
        u'last_ping_time': u'2018-12-05T15:24:20Z',


        I am grepping here just to show you example as full output for even 3 machines is quite big especially if you run it with additional switches:



        $ landscape-api get-computers --with-hardware


        or



        $ landscape-api get-computers --with-hardware --json


        Then you can additionally parse that with jq for additional text manipulation



        Hope this will help.






        share|improve this answer












        I believe that what you are asking for is how to manage Landscape server via CLI. Therefore I would like to point you to User Guide located here https://landscape.canonical.com/static/doc/user-guide/
        This will be a good start.



        With regards to CLI tools you would need to pick which one do you feel most comfortable with/ your preference:
        https://landscape.canonical.com/static/doc/api/



        And just to get you started there are 3 ways of using this API:



        command-line client: easy to use, shell-script friendly



        Python module: more powerful, recommended if you want to drive the API via Python



        low-level HTTP requests: in the case you want to know what is going on, or write a client for some other language



        My personal favourite is the command line client. Once you install landscape-api and source your keys ( you can find, generate and refresh them from Landscape server GUI, just click on your name when you are logged in) as per https://landscape.canonical.com/static/doc/api/api-client-package.html
        you can get all the information from your Landscape server and attached machines:



        example:



        $ landscape-api get-computers | grep host
        u'hostname': u'xxx.eu-west-2.compute.amazonaws.com',
        u'hostname': u'xxx.eu-west-2.compute.internal',
        u'hostname': u'laptop',

        $ landscape-api get-computers | grep ping
        u'last_ping_time': u'2018-12-05T16:45:39Z',
        u'last_ping_time': u'2018-12-05T16:45:39Z',
        u'last_ping_time': u'2018-12-05T15:24:20Z',


        I am grepping here just to show you example as full output for even 3 machines is quite big especially if you run it with additional switches:



        $ landscape-api get-computers --with-hardware


        or



        $ landscape-api get-computers --with-hardware --json


        Then you can additionally parse that with jq for additional text manipulation



        Hope this will help.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 5 at 16:53









        bogdan

        133112




        133112






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1081027%2fusing-landscape-from-command-line%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Mouse cursor on multiple screens with different PPI

            Agildo Ribeiro

            Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”