From c4174a90c6d3f0505ed8e724c1e0b1997c73eb4f Mon Sep 17 00:00:00 2001 From: Aman Bhardwaj Date: Tue, 21 Jan 2020 14:34:03 -0800 Subject: [PATCH] Updating Actor api refs to remove non transactional state apis. --- reference/api/actors.md | 98 ++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 64 deletions(-) diff --git a/reference/api/actors.md b/reference/api/actors.md index 9f29c22e1..b55ff30fd 100644 --- a/reference/api/actors.md +++ b/reference/api/actors.md @@ -49,42 +49,10 @@ curl -X POST http://localhost:3500/v1.0/actors/x-wing/33/method/fly \ > The response from the remote endpoint will be returned in the request body. -### Save Actor State -Saves the state for an actor using a specified key. +### Actor State Changes - Transaction -#### HTTP Request - -`POST/PUT http://localhost:/v1.0/actors///state/` - -#### HTTP Response Codes - -Code | Description ----- | ----------- -201 | Request successful -500 | Request failed -404 | Actor not found - -#### URL Parameters - -Parameter | Description ---------- | ----------- -daprPort | The Dapr port. -actorType | The actor type. -actorId | The actor ID. -key | The key for the state value. - -```shell -curl -X POST http://localhost:3500/v1.0/actors/stormtrooper/50/state/location \ - -H "Content-Type: application/json" - -d '{ - "location": "Alderaan" - }' -``` - -### Save Actor State - Transaction - -Saves the state for an actor as a multi-item transaction. +Persists the changed to the state for an actor as a multi-item transaction. ***Note that this operation is dependant on a state store that supports multi-item transactions.*** @@ -166,36 +134,6 @@ curl http://localhost:3500/v1.0/actors/stormtrooper/50/state/location \ } ``` -### Delete Actor State - -Deletes the state for an actor using a specified key. - -#### HTTP Request - -`DELETE http://localhost:/v1.0/actors///state/` - -#### HTTP Response Codes - -Code | Description ----- | ----------- -200 | Request successful -500 | Request failed -404 | Actor not found - -#### URL Parameters - -Parameter | Description ---------- | ----------- -daprPort | The Dapr port. -actorType | The actor type. -actorId | The actor ID. -key | The key for the state value. - -```shell -curl http://localhost:3500/v1.0/actors/stormtrooper/50/state/location \ - -X "Content-Type: application/json" -``` - ### Create Actor Reminder Creates a persistent reminder for an actor. @@ -471,6 +409,38 @@ curl -X DELETE http://localhost:3000/actors/stormtrooper/50 \ -H "Content-Type: application/json" ``` +### Invoke Actor method + +Invokes a method for an actor. + +#### HTTP Request + +`PUT http://localhost:/actors///method/` + +#### HTTP Response Codes + +Code | Description +---- | ----------- +200 | Request successful +500 | Request failed +404 | Actor not found + +#### URL Parameters + +Parameter | Description +--------- | ----------- +appPort | The application port. +actorType | The actor type. +actorId | The actor ID. +methodName | The name of the method to invoke. + +> Example of invoking a method for an actor: + +```shell +curl -X POST http://localhost:3000/actors/stormtrooper/50/method/performAction \ + -H "Content-Type: application/json" +``` + ### Invoke Reminder Invokes a reminder for an actor.