CreateOperations
Idempotent create operations for a domain model of an Openstack REST API.
Attributes
- Source
- CreateOperations.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
- Self type
-
PartialCrudService[F] & CreateNonIdempotentOperations[F, Model, Create] & UpdateOperations[F, Model, Update]
Members list
Value members
Abstract methods
An idempotent create. If the model that is to be created already exists then it will be updated, or simply returned if no modifications are necessary. The definition on what is considered already existing is left to the implementation as it is specific to the Model
in question.
An idempotent create. If the model that is to be created already exists then it will be updated, or simply returned if no modifications are necessary. The definition on what is considered already existing is left to the implementation as it is specific to the Model
in question.
Value parameters
- create
-
the values to use in the create.
- extraHeaders
-
extra headers to be used. The
authToken
header is always added. - keepExistingElements
-
the create operation can be interpreted with two possible meanings:
- Create a
Model
with the settings inCreate
. Extra settings that may already exist (when the model is being updated) will be preserved as much as possible. - Create a
Model
with exactly the settings inCreate
. Extra settings that may already exist are removed. This is done in a best effort approach, since its not achievable in the general case, as some settings are not updatable after creating the Model (the create and the update are asymmetric). SettingkeepExistingElements
totrue
will follow the logic in point 1. Setting it tofalse
will follow the logic in point 2, thus making the update more stringent. In most cases removing extra settings will break things, so this flag is set totrue
by default.
- Create a
- resolveConflict
-
the function used to resolve the conflict that will arise when the create is being performed on a model that already exists. By default it just invokes defaultResolveConflict.
Attributes
- Returns
-
the created domainModel, or if it already exists the existing or updated model.
- Source
- CreateOperations.scala
Default implementation to resolve the conflict that arises when implementing the createOrUpdate. In other words implements the idempotency logic of the create.
Default implementation to resolve the conflict that arises when implementing the createOrUpdate. In other words implements the idempotency logic of the create.
Value parameters
- create
-
the values to use in the create.
- existing
-
the existing domainModel.
- extraHeaders
-
extra headers to be used. The
authToken
header is always added. - keepExistingElements
-
whether to keep existing elements. See
createOrUpdate
for a more detailed explanation.
Attributes
- Returns
-
the existing model if no modifications are required, otherwise the updated model.
- Source
- CreateOperations.scala
Concrete methods
Creates a new domainModel with the given create
values using uri
. If a Conflict is returned execute onConflict
to resolve it.
Creates a new domainModel with the given create
values using uri
. If a Conflict is returned execute onConflict
to resolve it.
Value parameters
- create
-
the values to use in the create.
- extraHeaders
-
extra headers to be used. The
authToken
header is always added. - onConflict
-
the computation returning a domainModel to execute when a Conflict is returned in the create.
- uri
-
the uri to which the request will be made.
Attributes
- Returns
-
the created domainModel, or the updated domainModel by
onConflict
. - Source
- CreateOperations.scala
Creates a new domainModel with the given create
values using uri
. If the create is not successful the response will be parsed to an E
and the onConflict
partial function will be called. If the function is defined for the given E
the computation returned by it will be used to resolve the conflict. If the function is not defined F
will contain the parsed E
.
Creates a new domainModel with the given create
values using uri
. If the create is not successful the response will be parsed to an E
and the onConflict
partial function will be called. If the function is defined for the given E
the computation returned by it will be used to resolve the conflict. If the function is not defined F
will contain the parsed E
.
Value parameters
- create
-
the values to use in the create.
- extraHeaders
-
extra headers to be used. The
authToken
header is always added. - onConflict
-
the computation returning a domainModel to execute when a Conflict is returned in the create.
- uri
-
the uri to which the request will be made.
Attributes
- Returns
-
the created domainModel, or the updated domainModel by
onConflict
. - Source
- CreateOperations.scala
An idempotent create. If the model that is to be created already exists then it will be updated, or simply returned if no modifications are necessary. The definition on what is considered already existing is left to the implementation as it is specific to the Model
in question.
An idempotent create. If the model that is to be created already exists then it will be updated, or simply returned if no modifications are necessary. The definition on what is considered already existing is left to the implementation as it is specific to the Model
in question.
This function simply calls the overloaded version passing in keepExistingElements
set to true
.
Value parameters
- create
-
the values to use in the create.
- extraHeaders
-
extra headers to be used. The
authToken
header is always added.
Attributes
- Returns
-
the created domainModel, or if it already exists the existing or updated model.
- Source
- CreateOperations.scala
An idempotent create. If the model that is to be created already exists then it will be updated, or simply returned if no modifications are necessary. The definition on what is considered already existing is left to the implementation as it is specific to the Model
in question. defaultResolveConflict will be invoked to resolve the conflict that will arise when the create is being performed on a model that already exists.
An idempotent create. If the model that is to be created already exists then it will be updated, or simply returned if no modifications are necessary. The definition on what is considered already existing is left to the implementation as it is specific to the Model
in question. defaultResolveConflict will be invoked to resolve the conflict that will arise when the create is being performed on a model that already exists.
Value parameters
- create
-
the values to use in the create.
- extraHeaders
-
extra headers to be used. The
authToken
header is always added. - keepExistingElements
-
the create operation can be interpreted with two possible meanings:
- Create a
Model
with the settings inCreate
. Extra settings that may already exist (when the model is being updated) will be preserved as much as possible. - Create a
Model
with exactly the settings inCreate
. Extra settings that may already exist are removed. This is done in a best effort approach, since its not achievable in the general case, as some settings are not updatable after creating the Model (the create and the update are asymmetric). SettingkeepExistingElements
totrue
will follow the logic in point 1. Setting it tofalse
will follow point 2, thus making the update more stringent.
- Create a
Attributes
- Returns
-
the created domainModel, or if it already exists the existing or updated model.
- Source
- CreateOperations.scala