DX Unified Infrastructure Management

 View Only
  • 1.  api command to activate existing maintenance schedule

    Posted 22 days ago

    Hi guys,

    Just wondering if anyone has a recommended way of activating an existing maintenance schedule remotely via one of the apis?

    We've been using schedules (every 4th friday for example) but after some time, they stop working until someone goes through each of them and changes the start date to something more recent. we have an open ticket for this - well, this is the 3rd ticket we've had for the same fault but i digress.

    My idea is to have a handful of maintenance windows in OC, and have MECM activate said maintenance window prior to the patching outage.

    Something logically like "activate maintenance ID 708 for x hours"

    Any recommendations would be greatly appreciated!

    Cheers



  • 2.  RE: api command to activate existing maintenance schedule

    Broadcom Employee
    Posted 22 days ago

    hi Steve, 

    UIM provides uimapi: uimapi Call Reference (broadcom.com)

    You can control maintenance using one of the maintenance calls. via the built in Swagger or via command. 

    There is a call to: "Update a maintenance schedule in the UIM system with a new active window duration"

    Thanks,

    Marco, 



    ------------------------------
    Marco Ippati
    Senior Technical Support Engineer
    Broadcom Software | Agile Operation Division
    Barcelona, Spain | marco.ippati@broadcom.com
    ------------------------------



  • 3.  RE: api command to activate existing maintenance schedule

    Posted 21 days ago

    Thanks Marco,

    I did have a look at that API call and while it sounded hopeful, it doesn't seem to work for non active maintenance windows.

    /maintenance_mode/{domain}/{hub}/{robot}/new_duration_for_active_window/{schedule_id}/{duration_in_minutes}

    I was hoping to find a simple call, where it can activate any of the maintenance windows via it's ID for x minutes/hours.

    Workflow logic:

    • I have a maintenance window for a system that has ~30 hosts (id 2305)
    • The patching window is about to start
    • Send a call to start maintenance window ID 2305 for 4 hours

    Thanks again




  • 4.  RE: api command to activate existing maintenance schedule

    Posted 20 days ago

    Perhaps this webservices_rest call:

    /maintenance_mode/{domain}/{hub}/{robot}/new_duration_for_active_window/{schedule_id}/{duration_in_minutes}



  • 5.  RE: api command to activate existing maintenance schedule

    Posted 8 days ago

    Hi Marco,

    Any chance there's some documentation regarding creating a new maintenance window via the API?

    I'm looking at this one in particular: POST /uimapi/maintenance_mode/{domain}/{hub}/{robot}/add_schedule

    There's an example post body in swagger, but there's not much to describe which fields are necessary, which ones aren't and what the options for each are:

    {
      "account_id": "string",
      "description": "string",
      "end_time": {
        "duration": {
          "hours": 0,
          "minutes": 0,
          "seconds": 0
        },
        "end_date_time": {
          "day": 0,
          "month": 0,
          "timestamp": {
            "hours": 0,
            "minutes": 0,
            "seconds": 0
          },
          "year": 0
        },
        "type": "string"
      },
      "name": "string",
      "recurrence_day_of_the_month": "string",
      "recurrence_days_of_the_week": "string",
      "recurrence_end_date_time": {
        "day": 0,
        "month": 0,
        "timestamp": {
          "hours": 0,
          "minutes": 0,
          "seconds": 0
        },
        "year": 0
      },
      "recurrence_instance": "string",
      "recurrence_pattern": "string",
      "recurrence_period": "string",
      "start_date_time": {
        "day": 0,
        "month": 0,
        "timestamp": {
          "hours": 0,
          "minutes": 0,
          "seconds": 0
        },
        "year": 0
      },
      "timezone": "string"
    }

    The only detail swagger provides is:

    Recurrence pattern can be one of: daily, weekly, monthly
    Recurrence days of the week can be a comma-separated list of: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday

    Any guidance or assistance would be greatly appreciated.

    Cheers




  • 6.  RE: api command to activate existing maintenance schedule

    Posted 8 days ago

    There is a "create schedule" on this page: https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/ca-unified-infrastructure-management-probes/GA/probe-development-tools/restful-web-services/webservices-rest-apis/webservices-rest-call-reference/maintenance-calls.html

    which gives me a slightly better idea of what each field is for, but even after filling in the appropriate info - i still get an error 500:

    {
      "account_id": "-1",
      "description": "API Test",
      "end_time": {
        "duration": {
          "hours": 2,
          "minutes": 0,
          "seconds": 0
        },
        "end_date_time": {
          "day": 0,
          "month": 0,
          "timestamp": {
            "hours": 0,
            "minutes": 0,
            "seconds": 0
          },
          "year": 0
        },
        "type": "duration"
      },
      "name": "API Test",
      "recurrence_day_of_the_month": "15",
      "recurrence_days_of_the_week": "",
      "recurrence_end_date_time": {
        "day": 0,
        "month": 0,
        "timestamp": {
          "hours": 0,
          "minutes": 0,
          "seconds": 0
        },
        "year": 0
      },
      "recurrence_instance": "",
      "recurrence_pattern": "3",
      "recurrence_period": "Monthly",
      "start_date_time": {
        "day": 16,
        "month": 3,
        "timestamp": {
          "hours": 2,
          "minutes": 0,
          "seconds": 0
        },
        "year": 2023
      },
      "timezone": "Australia/Melbourne"
    }

    Not sure what I'm doing wrong?




  • 7.  RE: api command to activate existing maintenance schedule

    Posted 8 days ago

    This is an example that works (for me), goal to set in maint every Monday for 3600 seconds

    {
      "name": "test monday",
      "description": "Duration: 3600 seconds From: 2023-03-15 12:04:59",
      "start_date_time": {
        "month": "03",
        "day": "15",
        "year": "2023",
        "timestamp": {
          "hours": "12",
          "minutes": "04",
          "seconds": "59"
        }
      },
      "end_time": {
        "type": "duration",
        "end_date_time": {
          "month": "",
          "day": "",
          "year": "",
          "timestamp": {
            "hours": "",
            "minutes": "",
            "seconds": ""
          }
        },
        "duration": {
          "hours": "1",
          "minutes": "0",
          "seconds": "0"
        }
      },
      "recurrence_pattern": "weekly",
      "recurrence_period": "1",
      "recurrence_days_of_the_week": "monday",
      "recurrence_day_of_the_month": "",
      "recurrence_instance": "",
      "recurrence_end_date_time": {
        "month": "",
        "day": "",
        "year": "",
        "timestamp": {
          "hours": "",
          "minutes": "",
          "seconds": ""
        }
      },
      "timezone": "Europe/Brussels"
     }




  • 8.  RE: api command to activate existing maintenance schedule

    Posted 7 days ago

    Thanks @Luc Christiaens, always the man with the answer!

    Exactly what I was after :)