检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
model.*; public class InvokeFunctionSolution { public static void main(String[] args) { // 该示例仅为测试使用,在生产环境中请勿硬编码ak sk 信息在代码中
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
调试函数 在函数详情页的编码区中,通过配置测试事件进行函数调试。 在线调试函数 单击函数名称进入函数详情页,如图1所示,在“代码”页签下可以“配置测试事件”和“测试”函数进行在线调试。 图1 在线调试函数 父主题: 使用FunctionGraph函数访问Redis数据
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
使用FunctionGraph函数实现通过API方式上传文件 方案概述 资源规划 操作流程 父主题: 数据处理类实践
准备工作 购买Redis实例,如果已有Redis实例可以跳过。 查看Redis实例的连接信息,获取待连接Redis实例的IP地址。具体步骤请参见查看实例信息。 创建一个有“VPC Administrator”权限的FunctionGraph云服务委托,配置委托权限请参见配置委托权限。
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
FunctionGraph监控告警 Redis自动重试机制能大幅度降低暂时性故障影响,但不能解决故障,故障不及时处理可能导致故障升级,所以需要告警来及时感知代码运行情况。FunctionGraph支持通过创建告警规则完成对函数运行的实时监控,当函数指标出现满足设定规则时产生告警,
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
操作流程 本方案包含以下操作步骤 创建文件接收函数:接收上传的文件并解析内容。 端到端测试:绑定APIG触发器,测试文件上传及处理流程。 NodeJS语言方案 Python语言方案 父主题: 使用FunctionGraph函数实现通过API方式上传文件
Initializer格式为: [文件名].[initializer名] 示例:创建函数时指定的initializer为main.my_initializer,那么FunctionGraph会去加载main.php中定义的my_initializer函数。 在函数服务中使用PHP实现initialize
"UEsDBAoAAAAIABESwlDHSM8cOQYAAJYRAAAIAAAAaW5kZXgucHm9V91v2zYQf9dfcXAeLKeKkrYZNgTQQ9JvpG2CJsOwJ4GWaJuLRGok5VT963dHUpZsJ82GofVDQh2Pd8e7333wAI4Oj6BQ
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
创建依赖包 创建一个redis-py的依赖包,建议使用redis-py 4.6.0(校验包:redis-4.6.0.zip.sha256)版本。 登录函数工作流控制台,在左侧导航栏选择“函数 > 依赖包管理”,进入“依赖包管理”界面。 单击“创建依赖包”,弹出“创建依赖包”对话框。
方案概述 应用场景 端侧文件上传云服务器是Web和App应用的一类场景,例如服务运行日志的上报,Web应用图片上传等,函数可作为后端,结合APIG提供通用的API处理这类场景。本章节以NodeJS和Python语言为例,指导用户如何开发后端解析函数,获取上传的文件。 约束与限制 单次请求上传文件大小不超过6MB。
资源规划 表1 资源规划 产品 配置示例 API网关APIG 区域:北京四 规格:可使用共享版APIG或者创建专享版APIG实例 函数工作流FunctionGraph 区域:北京四 计费模式:按需计费 父主题: 使用FunctionGraph函数实现通过API方式上传文件
exceptions from huaweicloudsdkfunctiongraph.v2 import * if __name__ == "__main__": # 该示例仅为测试使用,在生产环境中请勿硬编码ak sk 信息在代码中 ak = "<YOUR AK>"
案例概述 本手册基于函数流服务实践所编写,用于指导您使用函数流服务实现OBS数据处理的功能。(当前函数流暂时支持华北-北京四、华东-上海一、华东-上海二、华南-广州、亚太-新加坡。) 场景介绍 用户使用函数流编排函数方式自动化处理OBS中的数据(如视频解析、图片转码、视频截图等)。