{"id":25806123,"url":"https://github.com/yandex-cloud-examples/yc-serverless-apigw-hello-world-python","last_synced_at":"2026-02-03T01:38:10.362Z","repository":{"id":277795463,"uuid":"771709052","full_name":"yandex-cloud-examples/yc-serverless-apigw-hello-world-python","owner":"yandex-cloud-examples","description":"Пример интеграции API Gateway и Yandex Cloud Functions с использованием контекста операции.","archived":false,"fork":false,"pushed_at":"2025-06-11T11:06:16.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-11T12:23:40.530Z","etag":null,"topics":["api-gateway","python3","serverless","yandex-cloud","yandex-function","yandexcloud"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yandex-cloud-examples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-13T19:56:32.000Z","updated_at":"2025-06-11T11:06:20.000Z","dependencies_parsed_at":"2025-02-16T07:33:06.728Z","dependency_job_id":null,"html_url":"https://github.com/yandex-cloud-examples/yc-serverless-apigw-hello-world-python","commit_stats":null,"previous_names":["yandex-cloud-examples/yc-serverless-apigw-hello-world-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yandex-cloud-examples/yc-serverless-apigw-hello-world-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-cloud-examples%2Fyc-serverless-apigw-hello-world-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-cloud-examples%2Fyc-serverless-apigw-hello-world-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-cloud-examples%2Fyc-serverless-apigw-hello-world-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-cloud-examples%2Fyc-serverless-apigw-hello-world-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yandex-cloud-examples","download_url":"https://codeload.github.com/yandex-cloud-examples/yc-serverless-apigw-hello-world-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-cloud-examples%2Fyc-serverless-apigw-hello-world-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29026412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T00:53:18.321Z","status":"ssl_error","status_checked_at":"2026-02-03T00:51:45.186Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gateway","python3","serverless","yandex-cloud","yandex-function","yandexcloud"],"created_at":"2025-02-27T19:59:36.381Z","updated_at":"2026-02-03T01:38:10.346Z","avatar_url":"https://github.com/yandex-cloud-examples.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Cloud Function Example\n\nПример интеграции API Gateway и Cloud Functions с использованием контеста операции.\nКонтекст операции - это параметр context расширения\n[x-yc-apigateway-integration:cloud_functions](https://cloud.yandex.ru/docs/api-gateway/concepts/extensions/cloud-functions)\nOpenAPI-спецификации. Значение данного параметра может иметь вложенную структуру, но ограничено размером в 2Kbyte.\nКонтекст операции позволяет параметризовать функцию-интеграцию для набора типовых операций OpenAPI-спецификации.\nВ примере API-гейтвей передает в функцию значение параметра пути запроса `/{name}` через поле\n`requestContext.apiGateway.operationContext.name`\n[контекста операции](https://cloud.yandex.ru/docs/functions/concepts/function-invoke#request)\n\n## Запуск\n\n1. Создайте облачную функции, в качестве среды выполнения выберите Python и вставьте код из [handler.py](handler.py)\n2. Создайте API Gateway и вставьте спецификацию из [openapi-example.yaml](openapi-example.yaml), \nподставив в неё идентификатор ранее созданной функции\n\nДля тестирования откройте в браузере `https://\u003cслужебный домен созданного API-шлюза\u003e/world`\n\n## Запуск функции из терминала\n\n    python3 main.py \u003cjson request\u003e [\u003cjson context\u003e]\n\n## Тесты\n\n    python3 test.py\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyandex-cloud-examples%2Fyc-serverless-apigw-hello-world-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyandex-cloud-examples%2Fyc-serverless-apigw-hello-world-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyandex-cloud-examples%2Fyc-serverless-apigw-hello-world-python/lists"}