• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Create scheduledtask via POST to API

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    3
    3
    337
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      nehsa
      last edited by

      Hello,

      Can anyone provide the data required in the post to create a CRON-style scheduled task?

      From https://news.fogproject.org/simplified-api-documentation, it looks like the URL is “/fog/<object>/create” but I don’t know what information to pass with it.

      e.g. I know I need these:
      “minute”: “30”,
      “hour”: “5”,
      “dayOfMonth”: “",
      “month”: "
      ”,
      “dayOfWeek”: “*”,

      What else?

      Thank you!

      Jesse

      1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator
        last edited by

        You might want to review @Wayne-Workman posts in this thread for some ideas: https://forums.fogproject.org/topic/9779/can-i-use-some-kind-of-script-to-create-image-and-ghost-my-lab-machines/14

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        1 Reply Last reply Reply Quote 0
        • Tom ElliottT
          Tom Elliott
          last edited by

          @nehsa said in Create scheduledtask via POST to API:

          “minute”: “30”,
          “hour”: “5”,
          “dayOfMonth”: “",
          “month”: "”,
          “dayOfWeek”: “*”,

          This all depends on the type of task this is to do:

          The json elements that you can set:

          {
              "name": 'Some Name',  // Optional
              "description": 'Some Description', // Optional
              "type": "C", // C = Cron, S = Single
              "taskType": 1, // ID of the task type, 1 = deploy, 2 = capture, 3 = debug do not use this one, 4 = memtest, 5 = test disk, 6 = disk surface test, 7 = recover, 8 = multicast, 10 = inventory, 11 = password reset, 12 = all snapins, 13 = single snapin, 14 = wake up, 15 = debug deploy, 16 = debug capture, 17 = deploy no snapins, 18 = fast wipe, 19 = normal wipe, 20 = full wipe
              "minute": 30,
              "hour": 5,
              "dayOfMonth": '*',
              "month": '*',
              "dayOfWeek": '*',
              "isGroupTask": 0, // 0 = host only, 1 = group task
              "hostID": 1, // If is grouptask is 1 this will be the group id, otherwise the relevant hostID
              "shutdown": 0, // 0 = restart, 1 = shutdown
              "other1": "",
              "other2": "-1", // Snapins either the id of the individual snapin, or -1 for all.
              "other3": "fog", // The username who created the task
              "other4": true, // Wake On Lan?
              "other5": "",
              "scheduleTime": "", // Only used for delayed time in which case you will need a valid unix timestamp in the future.
              "isActive": 1, // 0 or false would mean the task is not active currently.
              "imageID": 1 // The image ID in the case it's an imaging task. Can be any imageID you want.
          }
          

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post

          184

          Online

          12.0k

          Users

          17.3k

          Topics

          155.2k

          Posts
          Copyright © 2012-2024 FOG Project