Skip to main content

Alibaba Cloud FC Util Library for Python

Project description

README

Installation

  • install with pip tool.
# install alibabacloud_fc_open20210406
pip install -U alibabacloud_fc_open20210406

Usage

  • Invoke HTTP Trigger
# -*- coding: utf-8 -*-
import os

from alibabacloud_fc_open20210406.client import Client
from alibabacloud_tea_openapi import models as open_api_models

ak = os.getenv('ak')
sk = os.getenv('sk')
url = os.getenv('url')

client = Client(config=open_api_models.Config(access_key_id=ak,
                                              access_key_secret=sk,
                                              region_id='cn-hangzhou'))

resp = client.invoke_httptrigger(url=url,
                                 method="GET", 
                                 body="anything".encode(encoding='utf-8'),
                                 headers={"k1": "v1", "k2": "v2"})
  • Invoke Anonymous HTTP Trigger
import os

from alibabacloud_fc_open20210406.client import Client
from alibabacloud_tea_openapi import models as open_api_models

ak = os.getenv('ak')
sk = os.getenv('sk')
url = os.getenv('url')

client = Client(config=open_api_models.Config(access_key_id=ak,
                                              access_key_secret=sk,
                                              region_id='cn-hangzhou'))

resp = client.invoke_anonymous_httptrigger(url=url,
                                 method="GET", 
                                 body="anything".encode(encoding='utf-8'),
                                 headers={"k1": "v1", "k2": "v2"})
  • Integration with your own http_client
import requests
import os

from alibabacloud_fc_open20210406.client import Client
from alibabacloud_tea_openapi import models as open_api_models

ak = os.getenv('ak')
sk = os.getenv('sk')
url = os.getenv('url')

client = Client(config=open_api_models.Config(access_key_id=ak,
                                              access_key_secret=sk,
                                              region_id='cn-hangzhou'))

# build your own request
req = requests.Request(
    url=url,
    method='GET'
)
req = client.sign_request(req)
with requests.Session() as s:
    prep=s.prepare_request(req)
    resp = s.send(prep)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alibabacloud_gateway_fc_util-0.0.5.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file alibabacloud_gateway_fc_util-0.0.5.tar.gz.

File metadata

File hashes

Hashes for alibabacloud_gateway_fc_util-0.0.5.tar.gz
Algorithm Hash digest
SHA256 686b64776179d08828f9a2ea802f88552c15d5761fb145bf7ad1aeb3bdb1ba58
MD5 12be6fe50e87dccc0b1d20f67d74eda1
BLAKE2b-256 88d47b05bc4e100b3019dff6195e3b28d8f38770e58388666ae1dc86991a172a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page