{"action":"closed","issue":{"url":"https://api.github.com/repos/serverless/serverless/issues/1044","repository_url":"https://api.github.com/repos/serverless/serverless","labels_url":"https://api.github.com/repos/serverless/serverless/issues/1044/labels{/name}","comments_url":"https://api.github.com/repos/serverless/serverless/issues/1044/comments","events_url":"https://api.github.com/repos/serverless/serverless/issues/1044/events","html_url":"https://github.com/serverless/serverless/issues/1044","id":150347902,"number":1044,"title":"Endpoint deploy should also support function names as \"names\" parameter","user":{"login":"HyperBrain","id":5524702,"avatar_url":"https://avatars.githubusercontent.com/u/5524702?v=3","gravatar_id":"","url":"https://api.github.com/users/HyperBrain","html_url":"https://github.com/HyperBrain","followers_url":"https://api.github.com/users/HyperBrain/followers","following_url":"https://api.github.com/users/HyperBrain/following{/other_user}","gists_url":"https://api.github.com/users/HyperBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/HyperBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HyperBrain/subscriptions","organizations_url":"https://api.github.com/users/HyperBrain/orgs","repos_url":"https://api.github.com/users/HyperBrain/repos","events_url":"https://api.github.com/users/HyperBrain/events{/privacy}","received_events_url":"https://api.github.com/users/HyperBrain/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-04-22T11:51:02Z","updated_at":"2016-08-05T09:18:05Z","closed_at":"2016-08-05T09:18:05Z","body":"### Problem\r\nCurrently `sls endpoint deploy <names>` only supports the endpoint resource's path as name parameter. E.g. if you have a resource `/v1/tickets/{ticketnumber}` where GET is linked to lambda `getTickets` it is only allowed to specify `sls endpoint deploy /v1/tickets/{ticketnumber}~GET` to deploy the GET method.\r\n\r\nIf you follow a strict \"separation of concerns\" and security based approach where you have one lambda that handles all retrievals of data (with the permissions set accordingly) for multiple APIG paths and one lambda that handles data writes for these paths, you would like to specify the lambda name as endpoint name in the deploy command, to have all APIG paths deployed that refer to the redeployed lambda if you did some changes.\r\n\r\n### Example\r\nLet's have the following system definition:\r\n```\r\n/v1/tickets/{ticketnumber}\r\n    GET -> getTicketsLambda\r\n    DELETE -> changeTicketsLambda\r\n/v1/tickets\r\n    GET -> getTicketsLambda\r\n    POST -> changeTicketsLambda\r\n```\r\n\r\nIf we now apply changes to the `changeTicketsLambda` we would of course like to redeploy all endpoint methods that refer to the lambda. With the current implementation we have to remember or lookup all paths where the lambda is used and redeploy them each manually.\r\nIf you have an API with a lot of endpoints I'd bet that you miss one! (Of course you can redeploy the whole API, but for testing changes on a `test` stage every developer involved would kill you if he has to redeploy everything - and maybe overwrite other endpoints in the stage where other people are currently working on). \r\n\r\n### Proposal\r\nA more failsafe approach here would be that you can just `sls endpoint deploy changeTicketsLambda` and Serverless would redeploy the methods `/v1/tickets/{ticketnumber}~DELETE` and `/v1/tickets~POST`.\r\n\r\nComments welcome"}}
{"actor":{"display_login":"flomotlik"}}