## Update Spectrum application configuration using a name for the origin `spectrum.apps.update(strapp_id, AppUpdateParams**kwargs) -> AppUpdateResponse` **put** `/zones/{zone_id}/spectrum/apps/{app_id}` Updates a previously existing application's configuration that uses a name for the origin. ### Parameters - `zone_id: str` Zone identifier. - `app_id: str` App identifier. - `dns: DNSParam` The name and type of DNS record for the Spectrum application. - `name: Optional[str]` The name of the DNS record associated with the application. - `type: Optional[Literal["CNAME", "ADDRESS"]]` The type of DNS record associated with the application. - `"CNAME"` - `"ADDRESS"` - `protocol: str` The port configuration at Cloudflare's edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. - `traffic_type: Literal["direct", "http", "https"]` Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol`. When set to "http" or "https", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly. - `"direct"` - `"http"` - `"https"` - `argo_smart_routing: Optional[bool]` Enables Argo Smart Routing for this application. Notes: Only available for TCP applications with traffic_type set to "direct". - `edge_ips: Optional[EdgeIPsParam]` The anycast edge IP configuration for the hostname of this application. - `class Dynamic: …` - `connectivity: Optional[Literal["all", "ipv4", "ipv6"]]` The IP versions supported for inbound connections on Spectrum anycast IPs. - `"all"` - `"ipv4"` - `"ipv6"` - `type: Optional[Literal["dynamic"]]` The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names. - `"dynamic"` - `class Static: …` - `ips: Optional[List[str]]` The array of customer owned IPs we broadcast via anycast for this hostname and application. - `type: Optional[Literal["static"]]` The type of edge IP configuration specified. Statically allocated edge IPs use customer IPs in accordance with the ips array you specify. Only valid with ADDRESS DNS names. - `"static"` - `ip_firewall: Optional[bool]` Enables IP Access Rules for this application. Notes: Only available for TCP applications. - `origin_direct: Optional[SequenceNotStr[str]]` List of origin IP addresses. Array may contain multiple IP addresses for load balancing. - `origin_dns: Optional[OriginDNSParam]` The name and type of DNS record for the Spectrum application. - `name: Optional[str]` The name of the DNS record associated with the origin. - `ttl: Optional[int]` The TTL of our resolution of your DNS record in seconds. - `type: Optional[Literal["", "A", "AAAA", "SRV"]]` The type of DNS record associated with the origin. "" is used to specify a combination of A/AAAA records. - `""` - `"A"` - `"AAAA"` - `"SRV"` - `origin_port: Optional[OriginPortParam]` The destination port at the origin. Only specified in conjunction with origin_dns. May use an integer to specify a single origin port, for example `1000`, or a string to specify a range of origin ports, for example `"1000-2000"`. Notes: If specifying a port range, the number of ports in the range must match the number of ports specified in the "protocol" field. - `int` - `str` - `proxy_protocol: Optional[Literal["off", "v1", "v2", "simple"]]` Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol. - `"off"` - `"v1"` - `"v2"` - `"simple"` - `tls: Optional[Literal["off", "flexible", "full", "strict"]]` The type of TLS termination associated with the application. - `"off"` - `"flexible"` - `"full"` - `"strict"` ### Returns - `AppUpdateResponse` - `class SpectrumConfigAppConfig: …` - `id: str` App identifier. - `created_on: datetime` When the Application was created. - `dns: DNS` The name and type of DNS record for the Spectrum application. - `name: Optional[str]` The name of the DNS record associated with the application. - `type: Optional[Literal["CNAME", "ADDRESS"]]` The type of DNS record associated with the application. - `"CNAME"` - `"ADDRESS"` - `modified_on: datetime` When the Application was last modified. - `protocol: str` The port configuration at Cloudflare's edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. - `traffic_type: Literal["direct", "http", "https"]` Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol`. When set to "http" or "https", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly. - `"direct"` - `"http"` - `"https"` - `argo_smart_routing: Optional[bool]` Enables Argo Smart Routing for this application. Notes: Only available for TCP applications with traffic_type set to "direct". - `edge_ips: Optional[EdgeIPs]` The anycast edge IP configuration for the hostname of this application. - `class Dynamic: …` - `connectivity: Optional[Literal["all", "ipv4", "ipv6"]]` The IP versions supported for inbound connections on Spectrum anycast IPs. - `"all"` - `"ipv4"` - `"ipv6"` - `type: Optional[Literal["dynamic"]]` The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names. - `"dynamic"` - `class Static: …` - `ips: Optional[List[str]]` The array of customer owned IPs we broadcast via anycast for this hostname and application. - `type: Optional[Literal["static"]]` The type of edge IP configuration specified. Statically allocated edge IPs use customer IPs in accordance with the ips array you specify. Only valid with ADDRESS DNS names. - `"static"` - `ip_firewall: Optional[bool]` Enables IP Access Rules for this application. Notes: Only available for TCP applications. - `origin_direct: Optional[List[str]]` List of origin IP addresses. Array may contain multiple IP addresses for load balancing. - `origin_dns: Optional[OriginDNS]` The name and type of DNS record for the Spectrum application. - `name: Optional[str]` The name of the DNS record associated with the origin. - `ttl: Optional[int]` The TTL of our resolution of your DNS record in seconds. - `type: Optional[Literal["", "A", "AAAA", "SRV"]]` The type of DNS record associated with the origin. "" is used to specify a combination of A/AAAA records. - `""` - `"A"` - `"AAAA"` - `"SRV"` - `origin_port: Optional[OriginPort]` The destination port at the origin. Only specified in conjunction with origin_dns. May use an integer to specify a single origin port, for example `1000`, or a string to specify a range of origin ports, for example `"1000-2000"`. Notes: If specifying a port range, the number of ports in the range must match the number of ports specified in the "protocol" field. - `int` - `str` - `proxy_protocol: Optional[Literal["off", "v1", "v2", "simple"]]` Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol. - `"off"` - `"v1"` - `"v2"` - `"simple"` - `tls: Optional[Literal["off", "flexible", "full", "strict"]]` The type of TLS termination associated with the application. - `"off"` - `"flexible"` - `"full"` - `"strict"` - `class SpectrumConfigPaygoAppConfig: …` - `id: str` App identifier. - `created_on: datetime` When the Application was created. - `dns: DNS` The name and type of DNS record for the Spectrum application. - `modified_on: datetime` When the Application was last modified. - `protocol: str` The port configuration at Cloudflare's edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. - `origin_direct: Optional[List[str]]` List of origin IP addresses. Array may contain multiple IP addresses for load balancing. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) app = client.spectrum.apps.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", traffic_type="direct", ) print(app) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_on": "2014-01-01T05:20:00.12345Z", "dns": { "name": "ssh.example.com", "type": "CNAME" }, "modified_on": "2014-01-01T05:20:00.12345Z", "protocol": "tcp/22", "traffic_type": "direct", "argo_smart_routing": true, "edge_ips": { "connectivity": "all", "type": "dynamic" }, "ip_firewall": false, "origin_direct": [ "tcp://127.0.0.1:8080" ], "origin_dns": { "name": "origin.example.com", "ttl": 600, "type": "" }, "origin_port": 22, "proxy_protocol": "off", "tls": "off" } } ```