class documentation

FlexContainerInstance announced (FCIA) resource type.

Method update Update, add or remove resource attributes.

Inherited from AnnouncedResource:

Method updated Check whether we need to update the original resource.
Class Variable requestManager Injected RequestManager instance.

Inherited from Resource (via AnnouncedResource):

Method __contains__ Implementation of the membership test operator.
Method __delitem__ Implementation of the self[key| operation for deleting attributes.
Method __eq__ Test for equality of the resource to another resource.
Method __getattr__ Map the normal object attribute access to the internal resource attribute dictionary.
Method __getitem__ Implementation of the self[key| operation for retrieving attributes.
Method __init__ Initialization of a Resource instance.
Method __repr__ Object representation as string.
Method __setitem__ Implementation of the self[key] operation for assigning to attributes.
Method __str__ String representation of the resource's attributes.
Method activate This method is called to activate a resource, usually in a CREATE request.
Method asDict Get the JSON resource representation.
Method attribute Return the value of an attribute.
Method canHaveChild Check whether resource is a valild child resource for this resource.
Method childAdded Called after a child resource was added to the resource.
Method childRemoved Called when a child resource of the resource was removed.
Method childUpdated Called when a child resource was updated.
Method childWillBeAdded Called before a child will be added to a resource.
Method createChildResourceFromDict Create a child resource from a JSON dictionary.
Method dbCreate Add the resource to the database.
Method dbDelete Delete the resource from the database.
Method dbReload Load a new copy of the same resource from the database.
Method dbReloadDict Reload the resource instance from the database.
Method dbUpdate Update the resource in the database.
Method deactivate Deactivate an active resource.
Method decrementSubscriptionCounter Decrement the subscription counter for the resource.
Method delAttribute Delete the attribute 'key' from the resource.
Method getAttributes Get all attributes of the resource.
Method getCurrentOriginator Retrieve the current originator. This could be different from the originator / creator of the resource in case of the custodian attribute is set.
Method getFinalResourceAttribute Determine and return the final value of an attribute during an update.
Method getLocationCoordinates Retrieve a resource's location coordinates (internal attribute).
Method getOriginator Retrieve a resource's originator.
Method getRVI Retrieve a resource's release version indicator.
Method getSrn Retrieve a resource's full structured resource name.
Method getSubscriptionCounter Retrieve the subscription counter for the resource.
Method handleCreateRequest Process a CREATE request that is directed to a virtual resource.
Method handleDeleteRequest Process a DELETE request that is directed to a virtual resource.
Method handleNotification Process a notification request that is directed to a resource.
Method handleRetrieveRequest Process a RETRIEVE request that is directed to a virtual resource.
Method handleUpdateRequest Process a UPDATE request that is directed to a virtual resource.
Method hasAttribute Check whether an attribute exists for the resource.
Method hasAttributeDefined Test whether a resource supports the specified attribute. This method may be overwritten in sub-classes, for example for virtual resources.
Method incrementSubscriptionCounter Increment the subscription counter for the resource.
Method initialize This method is called when a new resource is created and before written to the database.
Method isAnnounced Test whether a the resource's type is an announced type.
Method isCreatedInternally Test whether a resource has been created for another resource.
Method isModifiedAfter Test whether this resource has been modified after another resource.
Method isVirtual Test whether the resource is a virtual resource.
Method retrieveParentResource Retrieve the parent resource of this resouce.
Method retrieveParentResourceRaw Retrieve the raw (!) parent resource of this resouce.
Method selectAttributes Determine the selected attributes for a partial retrieve of a resource.
Method setAttribute Assign a value to a resource attribute.
Method setCreatedInternally Save the resource ID for which this resource was created for.
Method setLocationCoordinates Set a resource's location coordinates (internal attribute).
Method setOriginator Set a resource's originator.
Method setResourceID Set the resource ID for the resource if not already set.
Method setResourceName Set the resource name.
Method setRVI Assign the release version for a resource.
Method setSrn Set a resource's full structured resource name.
Method structuredPath Determine the structured path of a resource.
Method typeAsString Return the resource type as a string. If the resource is a flex container, the specialization is added.
Method validate Validate a resource.
Method willBeDeactivated This method is called before a resource will be deactivated.
Method willBeRetrieved This method is called before a resource will be send back in a RETRIEVE response.
Method willBeUpdated This method is called before a resource will be updated and before calling the update() method.
Class Variable __slots__ Slots for the class.
Class Variable dispatcher Injected Dispatcher instance.
Class Variable factory Injected Factory instance.
Class Variable importer Injected Importer instance.
Class Variable notificationManager Injected NotificationManager instance.
Class Variable storage Injected Storage instance.
Class Variable validator Injected Validator instance.
Instance Variable dict Dictionary for public and internal resource attributes.
Method _checkAndFixACPIreferences Check whether a referenced ACP resoure exists, and if yes, change the ID in the list to CSE relative unstructured format.
Method _normalizeURIAttribute Normalize the URLs in the given attribute.
Class Variable _excludeFromUpdate Resource attributes that are excluded when updating the resource
Instance Variable _originalDict Original dictionary as it was created. This is used for validation in activate() later.
def update(self, dct: JSON | None = None, originator: str | None = None, doValidateAttributes: bool | None = True): ΒΆ

Update, add or remove resource attributes.

A subscription check for update is performed.

This method is implemented in sub-classes as well.

Note

This method updates the resource in the database. It should be called only after all other checks where performed.

Parameters
dct:JSON | NoneAn optional JSON dictionary with the attributes to be updated.
originator:str | NoneThe optional requests originator that let to the update of the resource.
doValidateAttributes:bool | NoneIf True optionally call the resource's validate() method.
Raises
CONTENTS_UNACCEPTABLEIn case of a resource mismatch.
BAD_REQUESTIn case of an invalid attribute.
INTERNAL_SERVER_ERRORIn case the parent resource coudln't be retrieved.