Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine the Service Status #13

Closed
36 tasks done
oliverspryn opened this issue Apr 16, 2020 · 0 comments · Fixed by #14
Closed
36 tasks done

Determine the Service Status #13

oliverspryn opened this issue Apr 16, 2020 · 0 comments · Fixed by #14
Assignees
Labels
Story Small unit of user-facing work
Milestone

Comments

@oliverspryn
Copy link
Collaborator

oliverspryn commented Apr 16, 2020

As a user, I need to know the status of my live streaming services so that I know when I can start to stream or when everything is shut down and I am no longer being billed.

Acceptance Criteria:

  • GIVEN a request to list the status of one or more live events and the live streaming endpoint
    • WHEN a request is made
      • THEN the endpoint is /status
      • AND the access type is authenticated
      • AND the live events are passed in as a query parameter called events=event1,event2
      • AND the streaming endpoint is passed as a query parameter called endpoint=name
    • WHEN not provided with the name of the streaming endpoint
      • THEN throw a 400 Bad Request error
      • AND stop further processing
      • AND create a JSON object, as follows:
        {
            "status": 400,
            "type": "InputValidationException",
            "message": "Input requires the name of a streaming endpoint",
            "developerMessage": "The query parameter 'endpoint' is required and must be the name of an existing streaming endpoint"
        }
        
    • WHEN not provided with the name of at least one or more live events (comma separated)
      • THEN throw a 400 Bad Request error
      • AND stop further processing
      • AND create a JSON object, as follows:
        {
            "status": 400,
            "type": "InputValidationException",
            "message": "Input requires the name of one or more live events",
            "developerMessage": "The query parameter 'events' is required and must be a comma-separated list of names of existing live events"
        }
        
    • WHEN not provided with the name of the streaming endpoint and the name of at least one or more live events (comma separated)
      • THEN throw a 400 Bad Request error
      • AND stop further processing
      • AND create a JSON object, as follows:
        {
            "status": 400,
            "type": "InputValidationException",
            "message": "Input requires the name of a streaming endpoint and the name of one or more live events",
            "developerMessage": "The query parameter 'endpoint' is required and must be the name of an existing streaming endpoint, and another query parameter 'events' is also required and must be a comma-separated list of names of existing live events"
        }
        
    • WHEN given a streaming endpoint, but it does not exist
      • THEN throw a 400 Bad Request error
      • AND stop further processing
      • AND create a JSON object, as follows:
        {
            "status": 400,
            "type": "ServiceValidationException",
            "message": "The given streaming endpoint does not exist",
            "developerMessage": "The query parameter 'endpoint' does not match the name of any existing streaming endpoints"
        }
        
    • WHEN given at least one live event but at least one of those events does not exist
      • THEN throw a 400 Bad Request error
      • AND stop further processing
      • AND create a JSON object, as follows:
        {
            "status": 400,
            "type": "ServiceValidationException",
            "message": "The following live event(s) do not exist: <comma separated list of invalid events>",
            "developerMessage": "The following live event(s) in the query parameter 'events' does not match the name(s) of any the existing live events: <comma separated list of invalid events>"
        }
        
    • WHEN given a streaming endpoint and at least one live event and all of those resources exist
      • THEN it checks the status of the streaming endpoint and all given live events
    • WHEN the streaming endpoint and all live events are stopped
      • THEN return a 200 OK response
      • AND create a JSON object, as follows:
        {
            "summary": "stopped",
            "endpoint": {
                "name": "<name of endpoint>",
                "status": "stopped"
            },
            "events": [{
                "name": "<name of event>",
                "status": "stopped"
            }, {
                // Addtional events here
            }]
        }
        
    • WHEN either the streaming endpoint or any live event is starting
      • THEN return a 200 OK response
      • AND create a JSON object, as follows:
        {
            "summary": "starting",
            "endpoint": {
                "name": "<name of endpoint>",
                "status": "<starting or whatever status it's currently in>"
            },
            "events": [{
                "name": "<name of event>",
                "status": "<starting or whatever status it's currently in>"
            }, {
                // Addtional events here
            }]
        }
        
    • WHEN the streaming endpoint and all live events are running
      • THEN return a 200 OK response
      • AND create a JSON object, as follows:
        {
            "summary": "running",
            "endpoint": {
                "name": "<name of endpoint>",
                "status": "running"
            },
            "events": [{
                "name": "<name of event>",
                "status": "running"
            }, {
                // Addtional events here
            }]
        }
        
    • WHEN either the streaming endpoint or any live event is stopping
      • THEN return a 200 OK response
      • AND create a JSON object, as follows:
        {
            "summary": "stopping",
            "endpoint": {
                "name": "<name of endpoint>",
                "status": "<stopping or whatever status it's currently in>"
            },
            "events": [{
                "name": "<name of event>",
                "status": "<stopping or whatever status it's currently in>"
            }, {
                // Addtional events here
            }]
        }
        
    • WHEN either the streaming endpoint or any live event is scaling and all of the rest are either scaling or running
      • THEN return a 200 OK response
      • AND create a JSON object, as follows:
        {
            "summary": "running",
            "endpoint": {
                "name": "<name of endpoint>",
                "status": "<running or scaling>"
            },
            "events": [{
                "name": "<name of event>",
                "status": "<running or scaling>"
            }, {
                // Addtional events here
            }]
        }
        
    • WHEN either the streaming endpoint or any live event is deleting and all of the rest are either deleting or stopped
      • THEN return a 200 OK response
      • AND create a JSON object, as follows:
        {
            "summary": "stopped",
            "endpoint": {
                "name": "<name of endpoint>",
                "status": "<stopped or deleting>"
            },
            "events": [{
                "name": "<name of event>",
                "status": "<stopped or deleting>"
            }, {
                // Addtional events here
            }]
        }
        
    • WHEN either the streaming endpoint or any live event is in an error state
      • THEN return a 200 OK response
      • AND create a JSON object, as follows:
        {
            "summary": "error",
            "endpoint": {
                "name": "<name of endpoint>",
                "status": "<error or whatever status it's currently in>"
            },
            "events": [{
                "name": "<name of event>",
                "status": "<error or whatever status it's currently in>"
            }, {
                // Addtional events here
            }]
        }
        
    • WHEN any of the above combinations are not satisfied
      • THEN return a 200 OK response
      • AND create a JSON object, as follows:
        {
            "summary": "error",
            "endpoint": {
                "name": "<name of endpoint>",
                "status": "<current state>"
            },
            "events": [{
                "name": "<name of event>",
                "status": "<current state>"
            }, {
                // Addtional events here
            }]
        }
        

Developer Notes:
Here are the business rules behind each state.

Azure Status Controller Summary Status Description When Controller Should Report
Stopped Stopped Service is stopped When all streaming endpoints and live events are stopped
Starting Starting Service is starting When any streaming endpoint or live event is starting, regardless of the status of others
Running Running Service is running When all streaming endpoints and live events are running
Stopping Stopping Service is stopping When any streaming endpoint or live event is stopping, regardless of the status of others
Scaling Running Service is running and scaling up or down When any streaming endpoint or live event is scaling, and all of the other resources are also in a scaling or running state
Deleting Stopped Service is stopped and is being removed When any streaming endpoint or live event is deleting, and all of the other resources are also in a deleting or stopped state
N/A Error Any of the above combinations are not satisfied Any of the above combinations are not satisfied
@oliverspryn oliverspryn added the Story Small unit of user-facing work label Apr 16, 2020
@oliverspryn oliverspryn added this to the 1.0.0 milestone Apr 16, 2020
@oliverspryn oliverspryn self-assigned this Apr 16, 2020
@oliverspryn oliverspryn linked a pull request Apr 24, 2020 that will close this issue
oliverspryn added a commit that referenced this issue Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Story Small unit of user-facing work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant