Skip to content

Example uses non-existent API #878

Description

@akx

The terminate_instance example

def terminate_instance(compute_client_composite_operations, instance):
print('Terminating Instance: {}'.format(instance.id))
compute_client_composite_operations.terminate_instance_and_wait_for_state(
instance.id,
wait_for_states=[oci.core.models.Instance.LIFECYCLE_STATE_TERMINATED]
)
print('Terminated Instance: {}'.format(instance.id))
print()

shows use of an API called terminate_instance_and_wait_for_state which was evidently removed in 2.178.0 (40a0ec4) in favor of terminate_instance_and_wait_for_work_request (with a different API surface).

There don't seem to be tests in this repo that would cover either terminate_instance_and_wait_for_state or terminate_instance_and_wait_for_work_request.

I do want to note that simply deleting a function that has existed since version 1.3.19 (from 2018) is developer-hostile in my books (and caused a minor production issue for us, but that is honestly on me for not having had suitable tests on our end).

Looking at the source, both terminate_instance_and_wait_for_state and terminate_instance_and_wait_for_work_request call client.terminate_instance(); there is no reason I can see that terminate_instance_and_wait_for_state couldn't coexist (with, if you'd like, a DeprecationWarning).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions