VM Schedules

Represents a VM Schedule. Associates a VM Group with a Weekly Schedule

Attributes

  • frequency - (Number) Not used. Reserved for future use
  • start-time - (ISODate) The initial time the schedule is in effect
  • normally - (Boolean) Not used. Deprecated in private API use.
  • name - (String) The name of the schedule
  • enabled - (Boolean) Indicates if the schedule is currently enabled or not. If set to false scheduled automation will not take place
  • notifications - (Boolean) Indicates if email notifications should be sent for this schedule
  • timezone - (String) The timezone represented as a tz database timezone
  • warning-secs - (Number) The number of seconds before the next scheduled automation time to send a warning notification

Relationships

  • weekly-schedule - (WeeklySchedule) Defines the actual weekly schedule of timespan events to execute on the VMs within the associated vm-group
  • vm-group - (VM Group) - The VM Group to associate with this VM Schedule. All scheduled actions will be executed against all VMs within this VM Group.
  • warning-timespan - Unused

Operations

GET /vm-schedules

Retrieves all VM Schedules available

{
    "links": {
        "self": "https://api.vmpower.io/vm-schedules"
    },
    "data": [
        {
            "id": "59d31cde52fcc91f1e5a563d",
            "type": "vm-schedules",
            "attributes": {
                "frequency": 1,
                "start-time": "2017-10-03T05:15:10.587Z",
                "normally": "on",
                "name": "CoreOS",
                "enabled": false,
                "notifications": true,
                "timezone": "US/Pacific",
                "warning-secs": 1800
            },
            "links": {
                "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d"
            },
            "relationships": {
                "weekly-schedule": {
                    "data": {
                        "type": "weekly-schedules",
                        "id": "59d31cde52fcc91f1e5a563c"
                    },
                    "links": {
                        "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/weekly-schedule"
                    }
                },
                "vm-group": {
                    "data": {
                        "type": "vm-groups",
                        "id": "598c9b23d905cc821736b771"
                    },
                    "links": {
                        "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/vm-group"
                    }
                },
                "warning-timespan": {
                    "data": null,
                    "links": {
                        "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/warning-timespan"
                    }
                }
            }
        }
    ]
}

GET /vm-schedules/:id

Retrieves a single VM Schedule based on a VM Id (:id)

{
    "links": {
        "self": "https://api.vmpower.io/vm-schedules"
    },
    "data": {
        "id": "59d31cde52fcc91f1e5a563d",
        "type": "vm-schedules",
        "attributes": {
            "frequency": 1,
            "start-time": "2017-10-03T05:15:10.587Z",
            "normally": "on",
            "name": "CoreOS",
            "enabled": false,
            "notifications": true,
            "timezone": "US/Pacific",
            "warning-secs": 1800
        },
        "links": {
            "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d"
        },
        "relationships": {
            "weekly-schedule": {
                "data": {
                    "type": "weekly-schedules",
                    "id": "59d31cde52fcc91f1e5a563c"
                },
                "links": {
                    "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/weekly-schedule"
                }
            },
            "vm-group": {
                "data": {
                    "type": "vm-groups",
                    "id": "598c9b23d905cc821736b771"
                },
                "links": {
                    "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/vm-group"
                }
            },
            "warning-timespan": {
                "data": null,
                "links": {
                    "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/warning-timespan"
                }
            }
        }
    }
}

PATCH /vm-schedules/:id

Modifies a single VM schedule with the resource identifier :id:

{
    "links": {
        "self": "https://api.vmpower.io/vm-schedules"
    },
    "data": {
        "id": "59d31cde52fcc91f1e5a563d",
        "type": "vm-schedules",
        "attributes": {
            "frequency": 1,
            "start-time": "2017-10-03T05:15:10.587Z",
            "normally": "on",
            "name": "CoreOS",
            "enabled": false,
            "notifications": true,
            "timezone": "US/Pacific",
            "warning-secs": 1800
        },
        "links": {
            "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d"
        },
        "relationships": {
            "weekly-schedule": {
                "data": {
                    "type": "weekly-schedules",
                    "id": "59d31cde52fcc91f1e5a563c"
                },
                "links": {
                    "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/weekly-schedule"
                }
            },
            "vm-group": {
                "data": {
                    "type": "vm-groups",
                    "id": "598c9b23d905cc821736b771"
                },
                "links": {
                    "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/vm-group"
                }
            },
            "warning-timespan": {
                "data": null,
                "links": {
                    "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/warning-timespan"
                }
            }
        }
    }
}

POST /vm-schedules

Creates a new VM Schedule

{
    "data": [
        {
            "type": "vm-schedules",
            "attributes": {
                "name": "CoreOS",
                "enabled": true
            },
            "relationships": {
                "weekly-schedule": {
                    "data": {
                        "type": "weekly-schedules",
                        "id": "59d31cde52fcc91f1e5a563c"
                    },
                    "links": {
                        "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/weekly-schedule"
                    }
                },
                "vm-group": {
                    "data": {
                        "type": "vm-groups",
                        "id": "598c9b23d905cc821736b771"
                    },
                    "links": {
                        "self": "https://api.vmpower.io/vm-schedules/59d31cde52fcc91f1e5a563d/relationships/vm-group"
                    }
                }
            }
        }
    ]
}