Exemplo n.º 1
0
def cli_reservation_update_reservation(client,
                                       reservation_order_id,
                                       reservation_id,
                                       applied_scope_type,
                                       applied_scopes=None,
                                       instance_flexibility=None):
    if applied_scopes:
        patch = Patch(applied_scope_type=applied_scope_type,
                      applied_scopes=[applied_scopes],
                      instance_flexibility=instance_flexibility)
    else:
        patch = Patch(applied_scope_type=applied_scope_type,
                      instance_flexibility=instance_flexibility)
    return client.update(reservation_order_id, reservation_id, patch)
 def test_update_reservation_to_shared(self):
     patch = Patch(applied_scope_type=AppliedScopeType.shared,
                   applied_scopes=None,
                   instance_flexibility=InstanceFlexibility.on)
     reservation = self.reservation_client.reservation.update(
         self.reservation_order_id, self.reservation_id, patch).result()
     self._validate_reservation(reservation)
 def test_update_reservation_to_single(self):
     scope = ["/subscriptions/{}".format(self.settings.SUBSCRIPTION_ID)]
     patch = Patch(applied_scope_type=AppliedScopeType.single,
                   applied_scopes=scope,
                   instance_flexibility=InstanceFlexibility.on)
     reservation = self.reservation_client.reservation.update(
         self.reservation_order_id, self.reservation_id, patch).result()
     self._validate_reservation(reservation)
 def test_update_reservation_to_shared(self):
     reservation_list = self.reservation_client.reservation.list(self.reservation_order_id)
     for reservation in reservation_list:
         if "Succeeded" in reservation.properties.provisioning_state:
             reservation_to_update = reservation
     reservation_id = reservation_to_update.id.split('/')[6];
     patch = Patch(applied_scope_type="Shared", applied_scopes=None, instance_flexibility="On")
     reservation = self.reservation_client.reservation.update(self.reservation_order_id, reservation_id, patch).result()
     self._validate_reservation(reservation)
 def test_update_reservation_to_single(self):
     reservation_list = self.reservation_client.reservation.list(self.reservation_order_id)
     for reservation in reservation_list:
         if "Succeeded" in reservation.properties.provisioning_state:
             reservation_to_update = reservation
     reservation_id = reservation_to_update.id.split('/')[6];
     patch = Patch(applied_scope_type="Single", applied_scopes=["/subscriptions/{}".format(self.settings.SUBSCRIPTION_ID)], instance_flexibility="On")
     reservation = self.reservation_client.reservation.update(self.reservation_order_id, reservation_id, patch).result()
     self._validate_reservation(reservation)