Compute/API returns objects

Registered by Dan Smith

An important step in the conversion to unified-object-model is making the compute/api.py::API (able to) return objects instead of DB models or dict representations thereof. This will help drive the conversion to objects for nova-api, nova-scheduler, and enable more of nova-compute to be able to do the same.

Implementation of this blueprint will be complete when compute/api.py::API is using objects instead of db query models, and is returning those objects (when the caller wants them) through its public APIs.

Blueprint information

Status:
Complete
Approver:
Dan Smith
Priority:
High
Drafter:
None
Direction:
Approved
Assignee:
Dan Smith
Definition:
Approved
Series goal:
Accepted for havana
Implementation:
Implemented
Milestone target:
milestone icon 2013.2
Started by
Dan Smith
Completed by
Russell Bryant

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/compute-api-objects,n,z

Addressed by: https://review.openstack.org/34911
    Make EC2 API request objects instead of converting them.

Addressed by: https://review.openstack.org/34912
    Add Instance.get_by_id() query method

Addressed by: https://review.openstack.org/34913
    Make compute_api.get() use objects natively

Addressed by: https://review.openstack.org/33702
    Make instance show and index use objects

Addressed by: https://review.openstack.org/35041
    Make servers::update() use Instance.save() to do the work

Addressed by: https://review.openstack.org/35050
    Make Instance.save() pass IPs as strings to DB API

Addressed by: https://review.openstack.org/35051
    Update v3 servers API with objects changes

Gerrit topic: https://review.openstack.org/#q,topic:bug/1196301,n,z

Addressed by: https://review.openstack.org/35065
    Refactor virt drivers' poll_rebooting_instances()

Addressed by: https://review.openstack.org/35066
    Make api_samples reboot test use a plausible scenario

Addressed by: https://review.openstack.org/35067
    WIP Make compute_api.reboot() use objects

Addressed by: https://review.openstack.org/35312
    Refactor compute_api reboot tests to be unit-y

Addressed by: https://review.openstack.org/35313
    Add fill_faults() batch operation to InstanceList

Addressed by: https://review.openstack.org/35314
    Fix compute_api object handling code in cells messaging

Addressed by: https://review.openstack.org/35223
    Convert pause/unpause to use objects

Addressed by: https://review.openstack.org/35224
    Convert suspend/resume to use objects

Addressed by: https://review.openstack.org/35575
    Add expected_vm_state to Instance.save()

Addressed by: https://review.openstack.org/35576
    *WIP* Dummy commit

Addressed by: https://review.openstack.org/35577
    Prep Instance.save() to handle cells DB updates

Addressed by: https://review.openstack.org/35578
    Make admin API state resets use Instance.save()

Addressed by: https://review.openstack.org/36542
    Integrate cells start/stop with compute RPCAPI

Addressed by: https://review.openstack.org/36583
    Move special cells logic for start/stop

Addressed by: https://review.openstack.org/36584
    Better compute_api.reboot handling for cells

Gerrit topic: https://review.openstack.org/#q,topic:bp/unified-object-model,n,z

Addressed by: https://review.openstack.org/36358
    Unit-ify compute_api delete tests

Addressed by: https://review.openstack.org/36359
    Fix default argument values on get_all_by_filters()

Addressed by: https://review.openstack.org/36489
    Add _set_instance_obj_error_state() to compute manager

Addressed by: https://review.openstack.org/36360
    Make notifications properly string-convert instance datetimes

Addressed by: https://review.openstack.org/36361
    Make db/api strip timezones for datetimes

Addressed by: https://review.openstack.org/36362
    Fix object_compat decorator for non-kwargs

Addressed by: https://review.openstack.org/36393
    Sync v2/v3 servers.py API files

Addressed by: https://review.openstack.org/36745
    Convert network API to use InfoCache object

Addressed by: https://review.openstack.org/36718
    Make InfoCache.network_info be the network model

Addressed by: https://review.openstack.org/36363
    Make delete/soft_delete use objects

Addressed by: https://review.openstack.org/37521
    Make shelve pass old-world instance object to conductor

Addressed by: https://review.openstack.org/38206
    Fix change detection logic in conductor

Addressed by: https://review.openstack.org/38207
    Add ObjectActionFailed exception and make Instance use it

Addressed by: https://review.openstack.org/38208
    Add obj_attr_is_set() method to NovaObject

Addressed by: https://review.openstack.org/38209
    Make fake_instance handle security groups

Addressed by: https://review.openstack.org/38210
    Add Instance.create()

Addressed by: https://review.openstack.org/38211
    Make compute_api use Instance.create()

Addressed by: https://review.openstack.org/38386
    Add Instance.destroy()

Addressed by: https://review.openstack.org/38387
    Make compute_api use Instance.destroy()

Addressed by: https://review.openstack.org/38891
    Make NovaObject.get() avoid lazy-load when defaulting

Addressed by: https://review.openstack.org/38892
    Pull out instance object handling for use by create also

Addressed by: https://review.openstack.org/39081
    Fix some Instance object class usage errors

Addressed by: https://review.openstack.org/39764
    Refactor compute API's delete to properly do local soft_deletes

Addressed by: https://review.openstack.org/39996
    Fix Instance objects with empty security groups

Gerrit topic: https://review.openstack.org/#q,topic:pci-passthrough-enhancement,n,z

Addressed by: https://review.openstack.org/40648
    Fix instance actions testing

Addressed by: https://review.openstack.org/40649
    Add delete() operation to InstanceInfoCache

Addressed by: https://review.openstack.org/40650
    Add basic InstanceAction object

Addressed by: https://review.openstack.org/40668
    Make compute_api use InstanceAction object

Addressed by: https://review.openstack.org/40679
    Deprecate conductor's compute_stop() interface

Addressed by: https://review.openstack.org/40682
    Deprecate conductor's compute_reboot() interface

Addressed by: https://review.openstack.org/41254
    Add Migration object

Addressed by: https://review.openstack.org/41573
    WIP Make compute_api migrate/resize paths use instance objects

Addressed by: https://review.openstack.org/41769
    Make compute_api use Migration object

Addressed by: https://review.openstack.org/41780
    Add KeyPair object

Addressed by: https://review.openstack.org/41986
    Make compute_api use KeyPair objects

Gerrit topic: https://review.openstack.org/#q,topic:keypairs,n,z

Addressed by: https://review.openstack.org/42029
    Add Service object implementation

Addressed by: https://review.openstack.org/42030
    Add ComputeNode object implementation

Addressed by: https://review.openstack.org/42031
    Link Service.compute_node with ComputeNode object

Addressed by: https://review.openstack.org/42032
    Make compute_api use Service and ComputeNode objects

Addressed by: https://review.openstack.org/42248
    Fix cells manager RPC version

Addressed by: https://review.openstack.org/42249
    Unit-ify the compute API resize tests

Addressed by: https://review.openstack.org/42250
    Convert admin_actions ext tests to unit tests

Addressed by: https://review.openstack.org/42340
    Make compute_api use objects for lock/unlock

Addressed by: https://review.openstack.org/42346
    Convert reset_network to use instance object

Addressed by: https://review.openstack.org/42262
    Pass objects for revert and confirm resizes

Addressed by: https://review.openstack.org/42332
    Fixup some non-unity-ness to conductor tests

Addressed by: https://review.openstack.org/42331
    Add scheduler utils unit tests

Addressed by: https://review.openstack.org/42665
    Make backup and snapshot use objects

Addressed by: https://review.openstack.org/42673
    Make inject_network_info use objects

Addressed by: https://review.openstack.org/42731
    Fix prep_resize() stale system_metadata issue

Addressed by: https://review.openstack.org/43156
    Add dict and list utility functions for object typing

Addressed by: https://review.openstack.org/43157
    Add Aggregate object model

Addressed by: https://review.openstack.org/43158
    Make compute_api use Aggregate objects

Addressed by: https://review.openstack.org/43192
    Fix instance metadata access in xenapi

Addressed by: https://review.openstack.org/31893
    Add BlockDeviceMapping objects

Addressed by: https://review.openstack.org/43031
    Change resize_instance paths to use objects

Addressed by: https://review.openstack.org/42999
    Deprecate conductor migration_create()

Addressed by: https://review.openstack.org/43018
    Change prep_resize paths to use objects

Addressed by: https://review.openstack.org/43080
    Change finish_resize paths to use objects

Addressed by: https://review.openstack.org/43108
    Deprecate conductor migration_get()

Addressed by: https://review.openstack.org/43106
    Convert _poll_unconfirmed_resizes to use Migration object

Addressed by: https://review.openstack.org/43107
    Change finish_revert_resize paths to use objects

Addressed by: https://review.openstack.org/39986
    Add new-world Quota object

Addressed by: https://review.openstack.org/39987
    Make _provision_instances() use Quotas obj

Addressed by: https://review.openstack.org/39985
    Create mixin class for common DB fields

Addressed by: https://review.openstack.org/39988
    Switch delete to use new-world Quotas object

Gerrit topic: https://review.openstack.org/#q,topic:bug/1212496,n,z

Addressed by: https://review.openstack.org/42534
    vm_state and task_state not updated during instance delete

Addressed by: https://review.openstack.org/44018
    Fix Instance object issues

Addressed by: https://review.openstack.org/44966
    Add missing Aggregate object tests

Addressed by: https://review.openstack.org/43754
    Generalize the _make_list() function for objects

Gerrit topic: https://review.openstack.org/#q,topic:bp/compute-manager-objects,n,z

Addressed by: https://review.openstack.org/51747
    Add CIDR field type

(?)

Work Items

Work items:
Instance actions: DONE
Migrations: INPROGRESS
Keypairs: INPROGRESS
Block Device Mappings: INPROGRESS
Services: INPROGRESS
Compute Nodes: INPROGRESS
Aggregates: INPROGRESS

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.