GSaha567/seq_level_training_data
052
1text,length,is_long_context,metric_val,label_metric2"[[netty-component]]3= Netty Component4 5*Since Camel 2.14*6 7// HEADER START8*Both producer and consumer is supported*9// HEADER END10 11The Netty component in Camel is a socket communication component,12based on the http://netty.io/[Netty] project version 4. +13 Netty is a NIO client server framework which enables quick and easy14development of networkServerInitializerFactory applications such as15protocol servers and clients. +16 Netty greatly simplifies and streamlines network programming such as17TCP and UDP socket server.18 19This camel component supports both producer and consumer endpoints.20 21The Netty component has several options and allows fine-grained control22of a number of TCP/UDP communication parameters (buffer sizes,23keepAlives, tcpNoDelay, etc) and facilitates both In-Only and In-Out24communication on a Camel route.25 26Maven users will need to add the following dependency to their `pom.xml`27for this component:28 29[source,xml]30----31<dependency>32 <groupId>org.apache.camel</groupId>33 <artifactId>camel-netty</artifactId>34 <version>x.x.x</version>35 <!-- use the same version as your Camel core version -->36</dependency>37----38 39== URI format40 41The URI scheme for a netty component is as follows42 43[source,text]44----45netty:tcp://0.0.0.0:99999[?options]46netty:udp://remotehost:99999/[?options]47----48 49This component supports producer and consumer endpoints for both TCP and50UDP.51 52You can append query options to the URI in the following format,53`?option=value&option=value&...`54 55== Options56 57// component options: START58The Netty component supports 72 options, which are listed below.59 60 61 62[width=""100%"",cols=""2,5,^1,2"",options=""header""]63|===64| Name | Description | Default | Type65| *configuration* (common) | To use the NettyConfiguration as configuration when creating endpoints. | | NettyConfiguration66| *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean67| *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean68| *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean69| *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an exchange property with the key NettyConstants#NETTY_CHANNEL which allows you to obtain the channel during routing and use it as well. | false | boolean70| *sync* (common) | Setting to set endpoint as one-way or request-response | true | boolean71| *tcpNoDelay* (common) | Setting to improve TCP protocol performance | true | boolean72| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean73| *broadcast* (consumer) | Setting to choose Multicast over UDP | false | boolean74| *clientMode* (consumer) | If the clientMode is true, netty consumer will connect the address as a TCP client. | false | boolean75| *reconnect* (consumer) | Used only in clientMode in consumer, the consumer will attempt to reconnect on disconnection if this is enabled | true | boolean76| *reconnectInterval* (consumer) | Used if reconnect and clientMode is enabled. The interval in milli seconds to attempt reconnection | 10000 | int77| *backlog* (consumer) | Allows to configure a backlog for netty consumer (server). Note the backlog is just a best effort depending on the OS. Setting this option to a value such as 200, 500 or 1000, tells the TCP stack how long the accept queue can be If this option is not configured, then the backlog depends on OS setting. | | int78| *bossCount* (consumer) | When netty works on nio mode, it uses default bossCount parameter from Netty, which is 1. User can use this option to override the default bossCount from Netty | 1 | int79| *bossGroup* (consumer) | Set the BossGroup which could be used for handling the new connection of the server side across the NettyEndpoint | | EventLoopGroup80| *disconnectOnNoReply* (consumer) | If sync is enabled then this option dictates NettyConsumer if it should disconnect where there is no reply to send back. | true | boolean81| *executorService* (consumer) | To use the given EventExecutorGroup. | | EventExecutorGroup82| *maximumPoolSize* (consumer) | Sets a maximum thread pool size for the netty consumer ordered thread pool. The default size is 2 x cpu_core plus 1. Setting this value to eg 10 will then use 10 threads unless 2 x cpu_core plus 1 is a higher value, which then will override and be used. For example if there are 8 cores, then the consumer thread pool will be 17. This thread pool is used to route messages received from Netty by Camel. We use a separate thread pool to ensure ordering of messages and also in case some messages will block, then nettys worker threads (event loop) wont be affected. | | int83| *nettyServerBootstrapFactory* (consumer) | To use a custom NettyServerBootstrapFactory | | NettyServerBootstrapFactory84| *networkInterface* (consumer) | When using UDP then this option can be used to specify a network interface by its name, such as eth0 to join a multicast group. | | String85| *noReplyLogLevel* (consumer) | If sync is enabled this option dictates NettyConsumer which logging level to use when logging a there is no reply to send back. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | WARN | LoggingLevel86| *serverClosedChannelException CaughtLogLevel* (consumer) | If the server (NettyConsumer) catches an java.nio.channels.ClosedChannelException then its logged using this logging level. This is used to avoid logging the closed channel exceptions, as clients can disconnect abruptly and then cause a flood of closed exceptions in the Netty server. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | DEBUG | LoggingLevel87| *serverExceptionCaughtLogLevel* (consumer) | If the server (NettyConsumer) catches an exception then its logged using this logging level. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | WARN | LoggingLevel88| *serverInitializerFactory* (consumer) | To use a custom ServerInitializerFactory | | ServerInitializerFactory89| *usingExecutorService* (consumer) | Whether to use ordered thread pool, to ensure events are processed orderly on the same channel. | true | boolean90| *connectTimeout* (producer) | Time to wait for a socket connection to be available. Value is in milliseconds. | 10000 | int91| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean92| *requestTimeout* (producer) | Allows to use a timeout for the Netty producer when calling a remote server. By default no timeout is in use. The value is in milli seconds, so eg 30000 is 30 seconds. The requestTimeout is using Netty's ReadTimeoutHandler to trigger the timeout. | | long93| *clientInitializerFactory* (producer) | To use a custom ClientInitializerFactory | | ClientInitializerFactory94| *correlationManager* (producer) | To use a custom correlation manager to manage how request and reply messages are mapped when using request/reply with the netty producer. This should only be used if you have a way to map requests together with replies such as if there is correlation ids in both the request and reply messages. This can be used if you want to multiplex concurrent messages on the same channel (aka connection) in netty. When doing this you must have a way to correlate the request and reply messages so you can store the right reply on the inflight Camel Exchange before its continued routed. We recommend extending the TimeoutCorrelationManagerSupport when you build custom correlation managers. This provides support for timeout and other complexities you otherwise would need to implement as well. See also the producerPoolEnabled option for more details. | | NettyCamelStateCorrelationManager95| *lazyChannelCreation* (producer) | Channels can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started. | true | boolean96| *producerPoolEnabled* (producer) | Whether producer pool is enabled or not. Important: If you turn this off then a single shared connection is used for the producer, also if you are doing request/reply. That means there is a potential issue with interleaved responses if replies comes back out-of-order. Therefore you need to have a correlation id in both the request and reply messages so you can properly correlate the replies to the Camel callback that is responsible for continue processing the message in Camel. To do this you need to implement NettyCamelStateCorrelationManager as correlation manager and configure it via the correlationManager option. See also the correlationManager option for more details. | true | boolean97| *producerPoolMaxActive* (producer) | Sets the cap on the number of objects that can be allocated by the pool (checked out to clients, or idle awaiting checkout) at a given time. Use a negative value for no limit. | -1 | int98| *producerPoolMaxIdle* (producer) | Sets the cap on the number of idle instances in the pool. | 100 | int99| *producerPoolMinEvictableIdle* (producer) | Sets the minimum amount of time (value in millis) an object may sit idle in the pool before it is eligible for eviction by the idle object evictor. | 300000 | long100| *producerPoolMinIdle* (producer) | Sets the minimum number of instances allowed in the producer pool before the evictor thread (if active) spawns new objects. | | int101| *udpConnectionlessSending* (producer) | This option supports connection less udp sending which is a real fire and forget. A connected udp send receive the PortUnreachableException if no one is listen on the receiving port. | false | boolean102| *useByteBuf* (producer) | If the useByteBuf is true, netty producer will turn the message body into ByteBuf before sending it out. | false | boolean103| *allowSerializedHeaders* (advanced) | Only used for TCP when transferExchange is true. When set to true, serializable objects in headers and properties will be added to the exchange. Otherwise Camel will exclude any non-serializable objects and log it at WARN level. | false | boolean104| *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean105| *channelGroup* (advanced) | To use a explicit ChannelGroup. | | ChannelGroup106| *nativeTransport* (advanced) | Whether to use native transport instead of NIO. Native transport takes advantage of the host operating system and is only supported on some platforms. You need to add the netty JAR for the host operating system you are using. See more details at: \\http://netty.io/wiki/native-transports.html | false | boolean107| *options* (advanced) | Allows to configure additional netty options using option. as prefix. For example option.child.keepAlive=false to set the netty option child.keepAlive=false. See the Netty documentation for possible options that can be used. | | Map108| *receiveBufferSize* (advanced) | The TCP/UDP buffer sizes to be used during inbound communication. Size is bytes. | 65536 | int109| *receiveBufferSizePredictor* (advanced) | Configures the buffer size predictor. See details at Jetty documentation and this mail thread. | | int110| *sendBufferSize* (advanced) | The TCP/UDP buffer sizes to be used during outbound communication. Size is bytes. | 65536 | int111| *transferExchange* (advanced) | Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body, Out body, fault body, In headers, Out headers, fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. | false | boolean112| *udpByteArrayCodec* (advanced) | For UDP only. If enabled the using byte array codec instead of Java serialization protocol. | false | boolean113| *workerCount* (advanced) | When netty works on nio mode, it uses default workerCount parameter from Netty (which is cpu_core_threads x 2). User can use this option to override the default workerCount from Netty. | | int114| *workerGroup* (advanced) | To use a explicit EventLoopGroup as the boss thread pool. For example to share a thread pool with multiple consumers or producers. By default each consumer or producer has their own worker pool with 2 x cpu count core threads. | | EventLoopGroup115| *allowDefaultCodec* (codec) | The netty component installs a default codec if both, encoder/decoder is null and textline is false. Setting allowDefaultCodec to false prevents the netty component from installing a default codec as the first element in the filter chain. | true | boolean116| *autoAppendDelimiter* (codec) | Whether or not to auto append missing end delimiter when sending using the textline codec. | true | boolean117| *decoderMaxLineLength* (codec) | The max line length to use for the textline codec. | 1024 | int118| *decoders* (codec) | A list of decoders to be used. You can use a String which have values separated by comma, and have the values be looked up in the Registry. Just remember to prefix the value with # so Camel knows it should lookup. | | List119| *delimiter* (codec) | The delimiter to use for the textline codec. Possible values are LINE and NULL. The value can be one of: LINE, NULL | LINE | TextLineDelimiter120| *encoders* (codec) | A list of encoders to be used. You can use a String which have values separated by comma, and have the values be looked up in the Registry. Just remember to prefix the value with # so Camel knows it should lookup. | | List121| *encoding* (codec) | The encoding (a charset name) to use for the textline codec. If not provided, Camel will use the JVM default Charset. | | String122| *textline* (codec) | Only used for TCP. If no codec is specified, you can use this flag to indicate a text line based codec; if not specified or the value is false, then Object Serialization is assumed over TCP - however only Strings are allowed to be serialized by default. | false | boolean123| *enabledProtocols* (security) | Which protocols to enable when using SSL | TLSv1,TLSv1.1,TLSv1.2 | String124| *keyStoreFile* (security) | Client side certificate keystore to be used for encryption | | File125| *keyStoreFormat* (security) | Keystore format to be used for payload encryption. Defaults to JKS if not set | | String126| *keyStoreResource* (security) | Client side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems. | | String127| *needClientAuth* (security) | Configures whether the server needs client authentication when using SSL. | false | boolean128| *passphrase* (security) | Password setting to use in order to encrypt/decrypt payloads sent using SSH | | String129| *securityProvider* (security) | Security provider to be used for payload encryption. Defaults to SunX509 if not set. | | String130| *ssl* (security) | Setting to specify whether SSL encryption is applied to this endpoint | false | boolean131| *sslClientCertHeaders* (security) | When enabled and in SSL mode, then the Netty consumer will enrich the Camel Message with headers having information about the client certificate such as subject name, issuer name, serial number, and the valid date range. | false | boolean132| *sslContextParameters* (security) | To configure security using SSLContextParameters | | SSLContextParameters133| *sslHandler* (security) | Reference to a class that could be used to return an SSL Handler | | SslHandler134| *trustStoreFile* (security) | Server side certificate keystore to be used for encryption | | File135| *trustStoreResource* (security) | Server side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems. | | String136| *useGlobalSslContextParameters* (security) | Enable usage of global SSL context parameters. | false | boolean137|===138// component options: END139 140 141// endpoint options: START142The Netty endpoint is configured using URI syntax:143 144----145netty:protocol:host:port146----147 148with the following path and query parameters:149 150=== Path Parameters (3 parameters):151 152 153[width=""100%"",cols=""2,5,^1,2"",options=""header""]154|===155| Name | Description | Default | Type156| *protocol* | *Required* The protocol to use which can be tcp or udp. The value can be one of: tcp, udp | | String157| *host* | *Required* The hostname. For the consumer the hostname is localhost or 0.0.0.0. For the producer the hostname is the remote host to connect to | | String158| *port* | *Required* The host port number | | int159|===160 161 162=== Query Parameters (71 parameters):163 164 165[width=""100%"",cols=""2,5,^1,2"",options=""header""]166|===167| Name | Description | Default | Type168| *disconnect* (common) | Whether or not to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer. | false | boolean169| *keepAlive* (common) | Setting to ensure socket is not closed due to inactivity | true | boolean170| *reuseAddress* (common) | Setting to facilitate socket multiplexing | true | boolean171| *reuseChannel* (common) | This option allows producers and consumers (in client mode) to reuse the same Netty Channel for the lifecycle of processing the Exchange. This is useful if you need to call a server multiple times in a Camel route and want to use the same network connection. When using this, the channel is not returned to the connection pool until the Exchange is done; or disconnected if the disconnect option is set to true. The reused Channel is stored on the Exchange as an exchange property with the key NettyConstants#NETTY_CHANNEL which allows you to obtain the channel during routing and use it as well. | false | boolean172| *sync* (common) | Setting to set endpoint as one-way or request-response | true | boolean173| *tcpNoDelay* (common) | Setting to improve TCP protocol performance | true | boolean174| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean175| *broadcast* (consumer) | Setting to choose Multicast over UDP | false | boolean176| *clientMode* (consumer) | If the clientMode is true, netty consumer will connect the address as a TCP client. | false | boolean177| *reconnect* (consumer) | Used only in clientMode in consumer, the consumer will attempt to reconnect on disconnection if this is enabled | true | boolean178| *reconnectInterval* (consumer) | Used if reconnect and clientMode is enabled. The interval in milli seconds to attempt reconnection | 10000 | int179| *backlog* (consumer) | Allows to configure a backlog for netty consumer (server). Note the backlog is just a best effort depending on the OS. Setting this option to a value such as 200, 500 or 1000, tells the TCP stack how long the accept queue can be If this option is not configured, then the backlog depends on OS setting. | | int180| *bossCount* (consumer) | When netty works on nio mode, it uses default bossCount parameter from Netty, which is 1. User can use this option to override the default bossCount from Netty | 1 | int181| *bossGroup* (consumer) | Set the BossGroup which could be used for handling the new connection of the server side across the NettyEndpoint | | EventLoopGroup182| *disconnectOnNoReply* (consumer) | If sync is enabled then this option dictates NettyConsumer if it should disconnect where there is no reply to send back. | true | boolean183| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler184| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. The value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern185| *nettyServerBootstrapFactory* (consumer) | To use a custom NettyServerBootstrapFactory | | NettyServerBootstrapFactory186| *networkInterface* (consumer) | When using UDP then this option can be used to specify a network interface by its name, such as eth0 to join a multicast group. | | String187| *noReplyLogLevel* (consumer) | If sync is enabled this option dictates NettyConsumer which logging level to use when logging a there is no reply to send back. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | WARN | LoggingLevel188| *serverClosedChannelException CaughtLogLevel* (consumer) | If the server (NettyConsumer) catches an java.nio.channels.ClosedChannelException then its logged using this logging level. This is used to avoid logging the closed channel exceptions, as clients can disconnect abruptly and then cause a flood of closed exceptions in the Netty server. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | DEBUG | LoggingLevel189| *serverExceptionCaughtLogLevel* (consumer) | If the server (NettyConsumer) catches an exception then its logged using this logging level. The value can be one of: TRACE, DEBUG, INFO, WARN, ERROR, OFF | WARN | LoggingLevel190| *serverInitializerFactory* (consumer) | To use a custom ServerInitializerFactory | | ServerInitializerFactory191| *usingExecutorService* (consumer) | Whether to use ordered thread pool, to ensure events are processed orderly on the same channel. | true | boolean192| *connectTimeout* (producer) | Time to wait for a socket connection to be available. Value is in milliseconds. | 10000 | int193| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean194| *requestTimeout* (producer) | Allows to use a timeout for the Netty producer when calling a remote server. By default no timeout is in use. The value is in milli seconds, so eg 30000 is 30 seconds. The requestTimeout is using Netty's ReadTimeoutHandler to trigger the timeout. | | long195| *clientInitializerFactory* (producer) | To use a custom ClientInitializerFactory | | ClientInitializerFactory196| *correlationManager* (producer) | To use a custom correlation manager to manage how request and reply messages are mapped when using request/reply with the netty producer. This should only be used if you have a way to map requests together with replies such as if there is correlation ids in both the request and reply messages. This can be used if you want to multiplex concurrent messages on the same channel (aka connection) in netty. When doing this you must have a way to correlate the request and reply messages so you can store the right reply on the inflight Camel Exchange before its continued routed. We recommend extending the TimeoutCorrelationManagerSupport when you build custom correlation managers. This provides support for timeout and other complexities you otherwise would need to implement as well. See also the producerPoolEnabled option for more details. | | NettyCamelStateCorrelationManager197| *lazyChannelCreation* (producer) | Channels can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started. | true | boolean198| *producerPoolEnabled* (producer) | Whether producer pool is enabled or not. Important: If you turn this off then a single shared connection is used for the producer, also if you are doing request/reply. That means there is a potential issue with interleaved responses if replies comes back out-of-order. Therefore you need to have a correlation id in both the request and reply messages so you can properly correlate the replies to the Camel callback that is responsible for continue processing the message in Camel. To do this you need to implement NettyCamelStateCorrelationManager as correlation manager and configure it via the correlationManager option. See also the correlationManager option for more details. | true | boolean199| *producerPoolMaxActive* (producer) | Sets the cap on the number of objects that can be allocated by the pool (checked out to clients, or idle awaiting checkout) at a given time. Use a negative value for no limit. | -1 | int200| *producerPoolMaxIdle* (producer) | Sets the cap on the number of idle instances in the pool. | 100 | int201| *producerPoolMinEvictableIdle* (producer) | Sets the minimum amount of time (value in millis) an object may sit idle in the pool before it is eligible for eviction by the idle object evictor. | 300000 | long202| *producerPoolMinIdle* (producer) | Sets the minimum number of instances allowed in the producer pool before the evictor thread (if active) spawns new objects. | | int203| *udpConnectionlessSending* (producer) | This option supports connection less udp sending which is a real fire and forget. A connected udp send receive the PortUnreachableException if no one is listen on the receiving port. | false | boolean204| *useByteBuf* (producer) | If the useByteBuf is true, netty producer will turn the message body into ByteBuf before sending it out. | false | boolean205| *allowSerializedHeaders* (advanced) | Only used for TCP when transferExchange is true. When set to true, serializable objects in headers and properties will be added to the exchange. Otherwise Camel will exclude any non-serializable objects and log it at WARN level. | false | boolean206| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean207| *channelGroup* (advanced) | To use a explicit ChannelGroup. | | ChannelGroup208| *nativeTransport* (advanced) | Whether to use native transport instead of NIO. Native transport takes advantage of the host operating system and is only supported on some platforms. You need to add the netty JAR for the host operating system you are using. See more details at: \\http://netty.io/wiki/native-transports.html | false | boolean209| *options* (advanced) | Allows to configure additional netty options using option. as prefix. For example option.child.keepAlive=false to set the netty option child.keepAlive=false. See the Netty documentation for possible options that can be used. | | Map210| *receiveBufferSize* (advanced) | The TCP/UDP buffer sizes to be used during inbound communication. Size is bytes. | 65536 | int211| *receiveBufferSizePredictor* (advanced) | Configures the buffer size predictor. See details at Jetty documentation and this mail thread. | | int212| *sendBufferSize* (advanced) | The TCP/UDP buffer sizes to be used during outbound communication. Size is bytes. | 65536 | int213| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean214| *transferExchange* (advanced) | Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body, Out body, fault body, In headers, Out headers, fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. | false | boolean215| *udpByteArrayCodec* (advanced) | For UDP only. If enabled the using byte array codec instead of Java serialization protocol. | false | boolean216| *workerCount* (advanced) | When netty works on nio mode, it uses default workerCount parameter from Netty (which is cpu_core_threads x 2). User can use this option to override the default workerCount from Netty. | | int217| *workerGroup* (advanced) | To use a explicit EventLoopGroup as the boss thread pool. For example to share a thread pool with multiple consumers or producers. By default each consumer or producer has their own worker pool with 2 x cpu count core threads. | | EventLoopGroup218| *allowDefaultCodec* (codec) | The netty component installs a default codec if both, encoder/decoder is null and textline is false. Setting allowDefaultCodec to false prevents the netty component from installing a default codec as the first element in the filter chain. | true | boolean219| *autoAppendDelimiter* (codec) | Whether or not to auto append missing end delimiter when sending using the textline codec. | true | boolean220| *decoderMaxLineLength* (codec) | The max line length to use for the textline codec. | 1024 | int221| *decoders* (codec) | A list of decoders to be used. You can use a String which have values separated by comma, and have the values be looked up in the Registry. Just remember to prefix the value with # so Camel knows it should lookup. | | List222| *delimiter* (codec) | The delimiter to use for the textline codec. Possible values are LINE and NULL. The value can be one of: LINE, NULL | LINE | TextLineDelimiter223| *encoders* (codec) | A list of encoders to be used. You can use a String which have values separated by comma, and have the values be looked up in the Registry. Just remember to prefix the value with # so Camel knows it should lookup. | | List224| *encoding* (codec) | The encoding (a charset name) to use for the textline codec. If not provided, Camel will use the JVM default Charset. | | String225| *textline* (codec) | Only used for TCP. If no codec is specified, you can use this flag to indicate a text line based codec; if not specified or the value is false, then Object Serialization is assumed over TCP - however only Strings are allowed to be serialized by default. | false | boolean226| *enabledProtocols* (security) | Which protocols to enable when using SSL | TLSv1,TLSv1.1,TLSv1.2 | String227| *keyStoreFile* (security) | Client side certificate keystore to be used for encryption | | File228| *keyStoreFormat* (security) | Keystore format to be used for payload encryption. Defaults to JKS if not set | | String229| *keyStoreResource* (security) | Client side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems. | | String230| *needClientAuth* (security) | Configures whether the server needs client authentication when using SSL. | false | boolean231| *passphrase* (security) | Password setting to use in order to encrypt/decrypt payloads sent using SSH | | String232| *securityProvider* (security) | Security provider to be used for payload encryption. Defaults to SunX509 if not set. | | String233| *ssl* (security) | Setting to specify whether SSL encryption is applied to this endpoint | false | boolean234| *sslClientCertHeaders* (security) | When enabled and in SSL mode, then the Netty consumer will enrich the Camel Message with headers having information about the client certificate such as subject name, issuer name, serial number, and the valid date range. | false | boolean235| *sslContextParameters* (security) | To configure security using SSLContextParameters | | SSLContextParameters236| *sslHandler* (security) | Reference to a class that could be used to return an SSL Handler | | SslHandler237| *trustStoreFile* (security) | Server side certificate keystore to be used for encryption | | File238| *trustStoreResource* (security) | Server side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems. | | String239|===240// endpoint options: END241 242 243 244== Registry based Options245 246Codec Handlers and SSL Keystores can be enlisted in the Registry, such as in the Spring XML file.247The values that could be passed in, are the following:248 249[width=""100%"",cols=""10%,90%"",options=""header"",]250|===251|Name |Description252 253|`passphrase` |password setting to use in order to encrypt/decrypt payloads sent using254SSH255 256|`keyStoreFormat` |keystore format to be used for payload encryption. Defaults to ""JKS"" if257not set258 259|`securityProvider` |Security provider to be used for payload encryption. Defaults to260""SunX509"" if not set.261 262|`keyStoreFile` |*deprecated:* Client side certificate keystore to be used for encryption263 264|`trustStoreFile` |*deprecated:* Server side certificate keystore to be used for encryption265 266|`keyStoreResource` |Client side certificate keystore to be used for267encryption. Is loaded by default from classpath, but you can prefix with268`""classpath:""`, `""file:""`, or `""http:""` to load the resource from269different systems.270 271|`trustStoreResource` |Server side certificate keystore to be used for272encryption. Is loaded by default from classpath, but you can prefix with273`""classpath:""`, `""file:""`, or `""http:""` to load the resource from274different systems.275 276|`sslHandler` |Reference to a class that could be used to return an SSL Handler277 278|`encoder` |A custom `ChannelHandler` class that can be used to perform special279marshalling of outbound payloads. Must override280io.netty.channel.ChannelInboundHandlerAdapter.281 282|`encoders` |A list of encoders to be used. You can use a String which have values283separated by comma, and have the values be looked up in the284Registry. Just remember to prefix the value with #285so Camel knows it should lookup.286 287|`decoder` |A custom `ChannelHandler` class that can be used to perform special288marshalling of inbound payloads. Must override289io.netty.channel.ChannelOutboundHandlerAdapter.290 291|`decoders` |A list of decoders to be used. You can use a String which have values292separated by comma, and have the values be looked up in the293Registry. Just remember to prefix the value with #294so Camel knows it should lookup.295|===296 297[NOTE]298====299Read below about using non shareable encoders/decoders.300====301 302=== Using non shareable encoders or decoders303 304If your encoders or decoders are not shareable (e.g. they don't have the305@Shareable class annotation), then your encoder/decoder must implement306the `org.apache.camel.component.netty.ChannelHandlerFactory` interface,307and return a new instance in the `newChannelHandler` method. This is to308ensure the encoder/decoder can safely be used. If this is not the case,309then the Netty component will log a WARN when an endpoint is created.310 311The Netty component offers a312`org.apache.camel.component.netty.ChannelHandlerFactories` factory313class, that has a number of commonly used methods.314 315== Sending Messages to/from a Netty endpoint316 317=== Netty Producer318 319In Producer mode, the component provides the ability to send payloads to320a socket endpoint using either TCP or UDP protocols (with optional SSL support).321 322The producer mode supports both one-way and request-response based operations.323 324=== Netty Consumer325 326In Consumer mode, the component provides the ability to:327 328* listen on a specified socket using either TCP or UDP protocols (with329optional SSL support),330* receive requests on the socket using text/xml, binary and serialized331object based payloads and332* send them along on a route as message exchanges.333 334The consumer mode supports both one-way and request-response based335operations.336 337== Examples338 339=== A UDP Netty endpoint using Request-Reply and serialized object payload340 341Note that Object serialization is not allowed by default, and so a decoder must be configured.342 343[source,java]344----345@BindToRegistry(""decoder"")346public ChannelHandler getDecoder() throws Exception {347 return new DefaultChannelHandlerFactory() {348 @Override349 public ChannelHandler newChannelHandler() {350 return new DatagramPacketObjectDecoder(ClassResolvers.weakCachingResolver(null));351 }352 };353}354 355RouteBuilder builder = new RouteBuilder() {356 public void configure() {357 from(""netty:udp://0.0.0.0:5155?sync=true&decoders=#decoder"")358 .process(new Processor() {359 public void process(Exchange exchange) throws Exception {360 Poetry poetry = (Poetry) exchange.getIn().getBody();361 // Process poetry in some way362 exchange.getOut().setBody(""Message received);363 }364 }365 }366};367----368 369=== A TCP based Netty consumer endpoint using One-way communication370 371[source,java]372----373RouteBuilder builder = new RouteBuilder() {374 public void configure() {375 from(""netty:tcp://0.0.0.0:5150"")376 .to(""mock:result"");377 }378};379----380 381=== An SSL/TCP based Netty consumer endpoint using Request-Reply communication382 383[[Netty-UsingtheJSSEConfigurationUtility]]384Using the JSSE Configuration Utility385 386The Netty component supports SSL/TLS configuration387through the xref:manual::camel-configuration-utilities.adoc[Camel JSSE388Configuration Utility]. This utility greatly decreases the amount of389component specific code you need to write and is configurable at the390endpoint and component levels. The following examples demonstrate how391to use the utility with the Netty component.392 393[[Netty-Programmaticconfigurationofthecomponent]]394Programmatic configuration of the component395 396[source,java]397----398KeyStoreParameters ksp = new KeyStoreParameters();399ksp.setResource(""/users/home/server/keystore.jks"");400ksp.setPassword(""keystorePassword"");401 402KeyManagersParameters kmp = new KeyManagersParameters();403kmp.setKeyStore(ksp);404kmp.setKeyPassword(""keyPassword"");405 406SSLContextParameters scp = new SSLContextParameters();407scp.setKeyManagers(kmp);408 409NettyComponent nettyComponent = getContext().getComponent(""netty"", NettyComponent.class);410nettyComponent.setSslContextParameters(scp);411----412 413[[Netty-SpringDSLbasedconfigurationofendpoint]]414Spring DSL based configuration of endpoint415 416[source,xml]417----418...419 <camel:sslContextParameters420 id=""sslContextParameters"">421 <camel:keyManagers422 keyPassword=""keyPassword"">423 <camel:keyStore424 resource=""/users/home/server/keystore.jks""425 password=""keystorePassword""/>426 </camel:keyManagers>427 </camel:sslContextParameters>...428...429 <to uri=""netty:tcp://0.0.0.0:5150?sync=true&ssl=true&sslContextParameters=#sslContextParameters""/>430...431----432 433[[Netty-UsingBasicSSL/TLSconfigurationontheJettyComponent]]434Using Basic SSL/TLS configuration on the Jetty Component435 436[source,java]437----438Registry registry = context.getRegistry();439registry.bind(""password"", ""changeit"");440registry.bind(""ksf"", new File(""src/test/resources/keystore.jks""));441registry.bind(""tsf"", new File(""src/test/resources/keystore.jks""));442 443context.addRoutes(new RouteBuilder() {444 public void configure() {445 String netty_ssl_endpoint =446 ""netty:tcp://0.0.0.0:5150?sync=true&ssl=true&passphrase=#password""447 + ""&keyStoreFile=#ksf&trustStoreFile=#tsf"";448 String return_string =449 ""When You Go Home, Tell Them Of Us And Say,""450 + ""For Your Tomorrow, We Gave Our Today."";451 452 from(netty_ssl_endpoint)453 .process(new Processor() {454 public void process(Exchange exchange) throws Exception {455 exchange.getOut().setBody(return_string);456 }457 }458 }459});460----461 462[[Netty-GettingaccesstoSSLSessionandtheclientcertificate]]463Getting access to SSLSession and the client certificate464 465You can get access to the `javax.net.ssl.SSLSession` if you eg need to466get details about the client certificate. When `ssl=true` then the467xref:netty-component.adoc[Netty] component will store the `SSLSession` as a468header on the Camel Message as shown below:469 470[source,java]471----472SSLSession session = exchange.getIn().getHeader(NettyConstants.NETTY_SSL_SESSION, SSLSession.class);473// get the first certificate which is client certificate474javax.security.cert.X509Certificate cert = session.getPeerCertificateChain()[0];475Principal principal = cert.getSubjectDN();476----477 478Remember to set `needClientAuth=true` to authenticate the client,479otherwise `SSLSession` cannot access information about the client480certificate, and you may get an exception481`javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated`. You482may also get this exception if the client certificate is expired or not483valid etc.484 485[TIP]486====487The option `sslClientCertHeaders` can be set to `true` which then488enriches the Camel Message with headers having489details about the client certificate. For example the subject name is490readily available in the header `CamelNettySSLClientCertSubjectName`.491====492 493=== Using Multiple Codecs494 495In certain cases it may be necessary to add chains of encoders and496decoders to the netty pipeline. To add multpile codecs to a camel netty497endpoint the 'encoders' and 'decoders' uri parameters should be used.498Like the 'encoder' and 'decoder' parameters they are used to supply499references (lists of ChannelUpstreamHandlers and500ChannelDownstreamHandlers) that should be added to the pipeline. Note501that if encoders is specified then the encoder param will be ignored,502similarly for decoders and the decoder param.503 504[NOTE]505====506Read further above about using non shareable encoders/decoders.507====508 509The lists of codecs need to be added to the Camel's registry so they can510be resolved when the endpoint is created.511 512[source,java]513----514ChannelHandlerFactory lengthDecoder = ChannelHandlerFactories.newLengthFieldBasedFrameDecoder(1048576, 0, 4, 0, 4);515 516StringDecoder stringDecoder = new StringDecoder();517registry.bind(""length-decoder"", lengthDecoder);518registry.bind(""string-decoder"", stringDecoder);519 520LengthFieldPrepender lengthEncoder = new LengthFieldPrepender(4);521StringEncoder stringEncoder = new StringEncoder();522registry.bind(""length-encoder"", lengthEncoder);523registry.bind(""string-encoder"", stringEncoder);524 525List<ChannelHandler> decoders = new ArrayList<ChannelHandler>();526decoders.add(lengthDecoder);527decoders.add(stringDecoder);528 529List<ChannelHandler> encoders = new ArrayList<ChannelHandler>();530encoders.add(lengthEncoder);531encoders.add(stringEncoder);532 533registry.bind(""encoders"", encoders);534registry.bind(""decoders"", decoders);535----536 537Spring's native collections support can be used to specify the codec538lists in an application context539 540[source,xml]541----542<util:list id=""decoders"" list-class=""java.util.LinkedList"">543 <bean class=""org.apache.camel.component.netty.ChannelHandlerFactories"" factory-method=""newLengthFieldBasedFrameDecoder"">544 <constructor-arg value=""1048576""/>545 <constructor-arg value=""0""/>546 <constructor-arg value=""4""/>547 <constructor-arg value=""0""/>548 <constructor-arg value=""4""/>549 </bean>550 <bean class=""io.netty.handler.codec.string.StringDecoder""/>551 </util:list>552 553 <util:list id=""encoders"" list-class=""java.util.LinkedList"">554 <bean class=""io.netty.handler.codec.LengthFieldPrepender"">555 <constructor-arg value=""4""/>556 </bean>557 <bean class=""io.netty.handler.codec.string.StringEncoder""/>558 </util:list>559 560 <bean id=""length-encoder"" class=""io.netty.handler.codec.LengthFieldPrepender"">561 <constructor-arg value=""4""/>562 </bean>563 <bean id=""string-encoder"" class=""io.netty.handler.codec.string.StringEncoder""/>564 565 <bean id=""length-decoder"" class=""org.apache.camel.component.netty.ChannelHandlerFactories"" factory-method=""newLengthFieldBasedFrameDecoder"">566 <constructor-arg value=""1048576""/>567 <constructor-arg value=""0""/>568 <constructor-arg value=""4""/>569 <constructor-arg value=""0""/>570 <constructor-arg value=""4""/>571 </bean>572 <bean id=""string-decoder"" class=""io.netty.handler.codec.string.StringDecoder""/>573----574 575The bean names can then be used in netty endpoint definitions either as576a comma separated list or contained in a List e.g.577 578[source,java]579----580 from(""direct:multiple-codec"").to(""netty:tcp://0.0.0.0:{{port}}?encoders=#encoders&sync=false"");581 582 from(""netty:tcp://0.0.0.0:{{port}}?decoders=#length-decoder,#string-decoder&sync=false"").to(""mock:multiple-codec"");583----584 585or via XML.586 587[source,xml]588----589<camelContext id=""multiple-netty-codecs-context"" xmlns=""http://camel.apache.org/schema/spring"">590 <route>591 <from uri=""direct:multiple-codec""/>592 <to uri=""netty:tcp://0.0.0.0:5150?encoders=#encoders&sync=false""/>593 </route>594 <route>595 <from uri=""netty:tcp://0.0.0.0:5150?decoders=#length-decoder,#string-decoder&sync=false""/>596 <to uri=""mock:multiple-codec""/>597 </route>598</camelContext>599----600 601== Closing Channel When Complete602 603When acting as a server you sometimes want to close the channel when,604for example, a client conversion is finished. +605 You can do this by simply setting the endpoint option606`disconnect=true`.607 608However you can also instruct Camel on a per message basis as follows. +609 To instruct Camel to close the channel, you should add a header with610the key `CamelNettyCloseChannelWhenComplete` set to a boolean `true`611value. +612 For instance, the example below will close the channel after it has613written the bye message back to the client:614 615[source,java]616----617from(""netty:tcp://0.0.0.0:8080"").process(new Processor() {618 public void process(Exchange exchange) throws Exception {619 String body = exchange.getIn().getBody(String.class);620 exchange.getOut().setBody(""Bye "" + body);621 // some condition which determines if we should close622 if (close) {623 exchange.getOut().setHeader(NettyConstants.NETTY_CLOSE_CHANNEL_WHEN_COMPLETE, true);624 }625 }626});627----628 629[[Netty-Addingcustomchannelpipelinefactoriestogaincompletecontroloveracreatedpipeline]]630Adding custom channel pipeline factories to gain complete control over a created pipeline631 632== Custom pipeline633 634Custom channel pipelines provide complete control to the user over the635handler/interceptor chain by inserting custom handler(s), encoder(s) &636decoder(s) without having to specify them in the Netty Endpoint URL in a637very simple way.638 639In order to add a custom pipeline, a custom channel pipeline factory640must be created and registered with the context via the context registry641(Registry, or the camel-spring ApplicationContextRegistry etc).642 643A custom pipeline factory must be constructed as follows644 645* A Producer linked channel pipeline factory must extend the abstract646class `ClientPipelineFactory`.647* A Consumer linked channel pipeline factory must extend the abstract648class `ServerInitializerFactory`.649* The classes should override the initChannel() method in order to650insert custom handler(s), encoder(s) and decoder(s). Not overriding the651`initChannel()` method creates a pipeline with no handlers, encoders or652decoders wired to the pipeline.653 654The example below shows how ServerInitializerFactory factory may be655created656 657=== Using custom pipeline factory658 659[source,java]660----661public class SampleServerInitializerFactory extends ServerInitializerFactory {662 private int maxLineSize = 1024;663 664 protected void initChannel(Channel ch) throws Exception {665 ChannelPipeline channelPipeline = ch.pipeline();666 667 channelPipeline.addLast(""encoder-SD"", new StringEncoder(CharsetUtil.UTF_8));668 channelPipeline.addLast(""decoder-DELIM"", new DelimiterBasedFrameDecoder(maxLineSize, true, Delimiters.lineDelimiter()));669 channelPipeline.addLast(""decoder-SD"", new StringDecoder(CharsetUtil.UTF_8));670 // here we add the default Camel ServerChannelHandler for the consumer, to allow Camel to route the message etc.671 channelPipeline.addLast(""handler"", new ServerChannelHandler(consumer));672 }673}674----675 676The custom channel pipeline factory can then be added to the registry677and instantiated/utilized on a camel route in the following way678 679[source,java]680----681Registry registry = camelContext.getRegistry();682ServerInitializerFactory factory = new TestServerInitializerFactory();683registry.bind(""spf"", factory);684context.addRoutes(new RouteBuilder() {685 public void configure() {686 String netty_ssl_endpoint =687 ""netty:tcp://0.0.0.0:5150?serverInitializerFactory=#spf""688 String return_string =689 ""When You Go Home, Tell Them Of Us And Say,""690 + ""For Your Tomorrow, We Gave Our Today."";691 692 from(netty_ssl_endpoint)693 .process(new Processor() {694 public void process(Exchange exchange) throws Exception {695 exchange.getOut().setBody(return_string);696 }697 }698 }699});700----701 702== Reusing Netty boss and worker thread pools703 704Netty has two kind of thread pools: boss and worker. By default each705Netty consumer and producer has their private thread pools. If you want706to reuse these thread pools among multiple consumers or producers then707the thread pools must be created and enlisted in the708Registry.709 710For example using Spring XML we can create a shared worker thread pool711using the `NettyWorkerPoolBuilder` with 2 worker threads as shown below:712 713[source,xml]714----715<!-- use the worker pool builder to help create the shared thread pool -->716<bean id=""poolBuilder"" class=""org.apache.camel.component.netty.NettyWorkerPoolBuilder"">717 <property name=""workerCount"" value=""2""/>718</bean>719 720<!-- the shared worker thread pool -->721<bean id=""sharedPool"" class=""org.jboss.netty.channel.socket.nio.WorkerPool""722 factory-bean=""poolBuilder"" factory-method=""build"" destroy-method=""shutdown"">723</bean>724----725 726[TIP]727====728For boss thread pool there is a729`org.apache.camel.component.netty.NettyServerBossPoolBuilder` builder730for Netty consumers, and a731`org.apache.camel.component.netty.NettyClientBossPoolBuilder` for the732Netty producers.733====734 735Then in the Camel routes we can refer to this worker pools by736configuring the `workerPool` option in the URI as shown below:737 738[source,xml]739----740<route>741 <from uri=""netty:tcp://0.0.0.0:5021?textline=true&sync=true&workerPool=#sharedPool&usingExecutorService=false""/>742 <to uri=""log:result""/>743 ...744</route>745----746 747And if we have another route we can refer to the shared worker pool:748 749[source,xml]750----751<route>752 <from uri=""netty:tcp://0.0.0.0:5022?textline=true&sync=true&workerPool=#sharedPool&usingExecutorService=false""/>753 <to uri=""log:result""/>754 ...755</route>756----757 758and so forth.759 760== Multiplexing concurrent messages over a single connection with request/reply761 762When using Netty for request/reply messaging via the netty producer then by default each763message is sent via a non-shared connection (pooled). This ensures that replies are764automatic being able to map to the correct request thread for further routing in Camel.765In other words correlation between request/reply messages happens out-of-the-box because766the replies comes back on the same connection that was used for sending the request;767and this connection is not shared with others. When the response comes back, the connection768is returned back to the connection pool, where it can be reused by others.769 770However if you want to multiplex concurrent request/responses on a single shared connection,771then you need to turn off the connection pooling by setting `producerPoolEnabled=false`.772Now this means there is a potential issue with interleaved responses if replies comes back out-of-order.773Therefore you need to have a correlation id in both the request and reply messages so you can properly774correlate the replies to the Camel callback that is responsible for continue processing the message in Camel.775To do this you need to implement `NettyCamelStateCorrelationManager` as correlation manager and configure776it via the `correlationManager=#myManager` option.777 778[NOTE]779====780We recommend extending the `TimeoutCorrelationManagerSupport` when you build custom correlation managers.781This provides support for timeout and other complexities you otherwise would need to implement as well.782====783 784You can find an example with the Apache Camel source code in the examples directory785under the `camel-example-netty-custom-correlation` directory.786 787 788include::camel-spring-boot::page$netty-starter.adoc[]789",12291,False,2306.2554028717386,median790"= v1.ServiceAccount791{product-author}792{product-version}793:data-uri:794:icons:795:toc: macro796:toc-title:797:toclevels: 2798 799toc::[]800 801== Description802[%hardbreaks]803ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets804 805== Object Schema806Expand or mouse-over a field for more information about it.807 808++++809<pre>810<div style=""margin-left:13px;""><span title=""(string) APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources"">apiVersion</span>:811</div><div style=""margin-left:13px;""><span title=""(boolean) AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level."">automountServiceAccountToken</span>:812</div><details><summary><span title=""(array) ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod"">imagePullSecrets</span>:813</summary><div style=""margin-left:13px;"">- <span title=""(string) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names"">name</span>:814</div></details><div style=""margin-left:13px;""><span title=""(string) Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"">kind</span>:815</div><details open><summary><span title=""(v1.ObjectMeta) Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata"">metadata</span>:816</summary><details><summary> <span title=""(object) Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations"">annotations</span>:817</summary><div style=""margin-left:13px;""> <span title=""(string)"">[string]</span>:818</div></details><div style=""margin-left:13px;""> <span title=""(string) The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request."">clusterName</span>:819</div><div style=""margin-left:13px;""> <span title=""(v1.Time) CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.820 821Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata"">creationTimestamp</span>:822</div><div style=""margin-left:13px;""> <span title=""(integer) Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only."">deletionGracePeriodSeconds</span>:823</div><div style=""margin-left:13px;""> <span title=""(v1.Time) DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.824 825Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata"">deletionTimestamp</span>:826</div><details><summary> <span title=""(array) Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed."">finalizers</span>:827</summary><div style=""margin-left:13px;""> - <span title=""(string)"">[string]</span>:828</div></details><div style=""margin-left:13px;""> <span title=""(string) GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.829 830If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).831 832Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency"">generateName</span>:833</div><div style=""margin-left:13px;""> <span title=""(integer) A sequence number representing a specific generation of the desired state. Populated by the system. Read-only."">generation</span>:834</div><details><summary> <span title=""(v1.Initializers) An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven't explicitly asked to observe uninitialized objects.835 836When an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user."">initializers</span>:837</summary><details><summary> <span title=""(array) Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients."">pending</span>:838</summary><div style=""margin-left:13px;""> - <span title=""(string) name of the process that is responsible for initializing this object."">name</span>:839</div></details><details><summary> <span title=""(v1.Status) If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion."">result</span>:840</summary><div style=""margin-left:13px;""> <span title=""(string) APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources"">apiVersion</span>:841</div><div style=""margin-left:13px;""> <span title=""(integer) Suggested HTTP return code for this status, 0 if not set."">code</span>:842</div><details><summary> <span title=""(v1.StatusDetails) Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type."">details</span>:843</summary><details><summary> <span title=""(array) The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes."">causes</span>:844</summary><div style=""margin-left:13px;""> - <span title=""(string) The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.845 846Examples:847 "name" - the field "name" on the current resource848 "items[0].name" - the field "name" on the first array entry in "items""">field</span>:849</div><div style=""margin-left:13px;""> <span title=""(string) A human-readable description of the cause of the error. This field may be presented as-is to a reader."">message</span>:850</div><div style=""margin-left:13px;""> <span title=""(string) A machine-readable description of the cause of the error. If this value is empty there is no information available."">reason</span>:851</div></details><div style=""margin-left:13px;""> <span title=""(string) The group attribute of the resource associated with the status StatusReason."">group</span>:852</div><div style=""margin-left:13px;""> <span title=""(string) The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"">kind</span>:853</div><div style=""margin-left:13px;""> <span title=""(string) The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described)."">name</span>:854</div><div style=""margin-left:13px;""> <span title=""(integer) If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action."">retryAfterSeconds</span>:855</div><div style=""margin-left:13px;""> <span title=""(string) UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids"">uid</span>:856</div></details><div style=""margin-left:13px;""> <span title=""(string) Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"">kind</span>:857</div><div style=""margin-left:13px;""> <span title=""(string) A human-readable description of the status of this operation."">message</span>:858</div><details><summary> <span title=""(v1.ListMeta) Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"">metadata</span>:859</summary><div style=""margin-left:13px;""> <span title=""(string) continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response."">continue</span>:860</div><div style=""margin-left:13px;""> <span title=""(string) String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency"">resourceVersion</span>:861</div><div style=""margin-left:13px;""> <span title=""(string) selfLink is a URL representing this object. Populated by the system. Read-only."">selfLink</span>:862</div></details><div style=""margin-left:13px;""> <span title=""(string) A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it."">reason</span>:863</div><div style=""margin-left:13px;""> <span title=""(string) Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status"">status</span>:864</div></details></details><details><summary> <span title=""(object) Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels"">labels</span>:865</summary><div style=""margin-left:13px;""> <span title=""(string)"">[string]</span>:866</div></details><div style=""margin-left:13px;""> <span title=""(string) Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names"">name</span>:867</div><div style=""margin-left:13px;""> <span title=""(string) Namespace defines the space within each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.868 869Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces"">namespace</span>:870</div><details><summary> <span title=""(array) List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller."">ownerReferences</span>:871</summary><div style=""margin-left:13px;""> - <span title=""(string) API version of the referent."">apiVersion</span>:872</div><div style=""margin-left:13px;""> <span title=""(boolean) If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned."">blockOwnerDeletion</span>:873</div><div style=""margin-left:13px;""> <span title=""(boolean) If true, this reference points to the managing controller."">controller</span>:874</div><div style=""margin-left:13px;""> <span title=""(string) Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"">kind</span>:875</div><div style=""margin-left:13px;""> <span title=""(string) Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names"">name</span>:876</div><div style=""margin-left:13px;""> <span title=""(string) UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"">uid</span>:877</div></details><div style=""margin-left:13px;""> <span title=""(string) An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.878 879Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency"">resourceVersion</span>:880</div><div style=""margin-left:13px;""> <span title=""(string) SelfLink is a URL representing this object. Populated by the system. Read-only."">selfLink</span>:881</div><div style=""margin-left:13px;""> <span title=""(string) UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.882 883Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"">uid</span>:884</div></details><details><summary><span title=""(array) Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. More info: https://kubernetes.io/docs/concepts/configuration/secret"">secrets</span>:885</summary><div style=""margin-left:13px;"">- <span title=""(string) API version of the referent."">apiVersion</span>:886</div><div style=""margin-left:13px;""> <span title=""(string) If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object."">fieldPath</span>:887</div><div style=""margin-left:13px;""> <span title=""(string) Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"">kind</span>:888</div><div style=""margin-left:13px;""> <span title=""(string) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names"">name</span>:889</div><div style=""margin-left:13px;""> <span title=""(string) Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/"">namespace</span>:890</div><div style=""margin-left:13px;""> <span title=""(string) Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency"">resourceVersion</span>:891</div><div style=""margin-left:13px;""> <span title=""(string) UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids"">uid</span>:892</div></details>893</pre>894++++895 896== Operations897 898[[Post-api-v1-namespaces-namespace-serviceaccounts]]899=== Create a ServiceAccount in a namespace900Create a ServiceAccount901 902==== HTTP request903----904POST /api/v1/namespaces/$NAMESPACE/serviceaccounts HTTP/1.1905Authorization: Bearer $TOKEN906Accept: application/json907Connection: close908Content-Type: application/json'909 910{911 ""kind"": ""ServiceAccount"",912 ""apiVersion"": ""v1"",913 ...914}915 916----917 918==== Curl request919----920$ curl -k \\921 -X POST \\922 -d @- \\923 -H ""Authorization: Bearer $TOKEN"" \\924 -H 'Accept: application/json' \\925 -H 'Content-Type: application/json' \\926 https://$ENDPOINT/api/v1/namespaces/$NAMESPACE/serviceaccounts <<'EOF'927{928 ""kind"": ""ServiceAccount"",929 ""apiVersion"": ""v1"",930 ...931}932EOF933----934 935==== HTTP body936[cols=""1,5"", options=""header""]937|===938|Parameter|Schema939|body|v1.ServiceAccount940|===941 942==== Path parameters943[cols=""1,5"", options=""header""]944|===945|Parameter|Description946|namespace|object name and auth scope, such as for teams and projects947|===948 949==== Query parameters950[cols=""1,5"", options=""header""]951|===952|Parameter|Description953|pretty|If 'true', then the output is pretty printed.954|===955 956==== Responses957[cols=""1,5"", options=""header""]958|===959|HTTP Code|Schema960|200 OK|v1.ServiceAccount961|201 Created|v1.ServiceAccount962|202 Accepted|v1.ServiceAccount963|401 Unauthorized|964|===965 966==== Consumes967 968* \\*/*969 970==== Produces971 972* application/json973* application/yaml974* application/vnd.kubernetes.protobuf975 976 977[[Get-api-v1-namespaces-namespace-serviceaccounts-name]]978=== Get a ServiceAccount in a namespace979Read the specified ServiceAccount980 981==== HTTP request982----983GET /api/v1/namespaces/$NAMESPACE/serviceaccounts/$NAME HTTP/1.1984Authorization: Bearer $TOKEN985Accept: application/json986Connection: close987----988 989==== Curl request990----991$ curl -k \\992 -H ""Authorization: Bearer $TOKEN"" \\993 -H 'Accept: application/json' \\994 https://$ENDPOINT/api/v1/namespaces/$NAMESPACE/serviceaccounts/$NAME995----996 997==== Path parameters998[cols=""1,5"", options=""header""]999|===1000|Parameter|Description1001|name|name of the ServiceAccount1002|namespace|object name and auth scope, such as for teams and projects1003|===1004 1005==== Query parameters1006[cols=""1,5"", options=""header""]1007|===1008|Parameter|Description1009|pretty|If 'true', then the output is pretty printed.1010|exact|Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.1011|export|Should this value be exported. Export strips fields that a user can not specify.1012|===1013 1014==== Responses1015[cols=""1,5"", options=""header""]1016|===1017|HTTP Code|Schema1018|200 OK|v1.ServiceAccount1019|401 Unauthorized|1020|===1021 1022==== Consumes1023 1024* \\*/*1025 1026==== Produces1027 1028* application/json1029* application/yaml1030* application/vnd.kubernetes.protobuf1031 1032 1033[[Get-api-v1-serviceaccounts]]1034=== Get all ServiceAccounts1035List or watch objects of kind ServiceAccount1036 1037==== HTTP request1038----1039GET /api/v1/serviceaccounts HTTP/1.11040Authorization: Bearer $TOKEN1041Accept: application/json1042Connection: close1043----1044 1045==== Curl request1046----1047$ curl -k \\1048 -H ""Authorization: Bearer $TOKEN"" \\1049 -H 'Accept: application/json' \\1050 https://$ENDPOINT/api/v1/serviceaccounts1051----1052 1053==== Query parameters1054[cols=""1,5"", options=""header""]1055|===1056|Parameter|Description1057|continue|The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.1058|fieldSelector|A selector to restrict the list of returned objects by their fields. Defaults to everything.1059|includeUninitialized|If true, partially initialized resources are included in the response.1060|labelSelector|A selector to restrict the list of returned objects by their labels. Defaults to everything.1061|limit|limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.1062 1063The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.1064|pretty|If 'true', then the output is pretty printed.1065|resourceVersion|When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.1066|timeoutSeconds|Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.1067|watch|Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.1068|===1069 1070==== Responses1071[cols=""1,5"", options=""header""]1072|===1073|HTTP Code|Schema1074|200 OK|v1.ServiceAccountList1075|401 Unauthorized|1076|===1077 1078==== Consumes1079 1080* \\*/*1081 1082==== Produces1083 1084* application/json1085* application/yaml1086* application/vnd.kubernetes.protobuf1087* application/json;stream=watch1088* application/vnd.kubernetes.protobuf;stream=watch1089 1090 1091[[Get-api-v1-namespaces-namespace-serviceaccounts]]1092=== Get all ServiceAccounts in a namespace1093List or watch objects of kind ServiceAccount1094 1095==== HTTP request1096----1097GET /api/v1/namespaces/$NAMESPACE/serviceaccounts HTTP/1.11098Authorization: Bearer $TOKEN1099Accept: application/json1100Connection: close1101----1102 1103==== Curl request1104----1105$ curl -k \\1106 -H ""Authorization: Bearer $TOKEN"" \\1107 -H 'Accept: application/json' \\1108 https://$ENDPOINT/api/v1/namespaces/$NAMESPACE/serviceaccounts1109----1110 1111==== Path parameters1112[cols=""1,5"", options=""header""]1113|===1114|Parameter|Description1115|namespace|object name and auth scope, such as for teams and projects1116|===1117 1118==== Query parameters1119[cols=""1,5"", options=""header""]1120|===1121|Parameter|Description1122|pretty|If 'true', then the output is pretty printed.1123|continue|The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.1124|fieldSelector|A selector to restrict the list of returned objects by their fields. Defaults to everything.1125|includeUninitialized|If true, partially initialized resources are included in the response.1126|labelSelector|A selector to restrict the list of returned objects by their labels. Defaults to everything.1127|limit|limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.1128 1129The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.1130|resourceVersion|When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.1131|timeoutSeconds|Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.1132|watch|Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.1133|===1134 1135==== Responses1136[cols=""1,5"", options=""header""]1137|===1138|HTTP Code|Schema1139|200 OK|v1.ServiceAccountList1140|401 Unauthorized|1141|===1142 1143==== Consumes1144 1145* \\*/*1146 1147==== Produces1148 1149* application/json1150* application/yaml1151* application/vnd.kubernetes.protobuf1152* application/json;stream=watch1153* application/vnd.kubernetes.protobuf;stream=watch1154 1155 1156[[Get-api-v1-watch-namespaces-namespace-serviceaccounts-name]]1157=== Watch a ServiceAccount in a namespace1158Watch changes to an object of kind ServiceAccount1159 1160==== HTTP request1161----1162GET /api/v1/watch/namespaces/$NAMESPACE/serviceaccounts/$NAME HTTP/1.11163Authorization: Bearer $TOKEN1164Accept: application/json1165Connection: close1166----1167 1168==== Curl request1169----1170$ curl -k \\1171 -H ""Authorization: Bearer $TOKEN"" \\1172 -H 'Accept: application/json' \\1173 https://$ENDPOINT/api/v1/watch/namespaces/$NAMESPACE/serviceaccounts/$NAME1174----1175 1176==== Path parameters1177[cols=""1,5"", options=""header""]1178|===1179|Parameter|Description1180|name|name of the ServiceAccount1181|namespace|object name and auth scope, such as for teams and projects1182|===1183 1184==== Query parameters1185[cols=""1,5"", options=""header""]1186|===1187|Parameter|Description1188|continue|The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.1189|fieldSelector|A selector to restrict the list of returned objects by their fields. Defaults to everything.1190|includeUninitialized|If true, partially initialized resources are included in the response.1191|labelSelector|A selector to restrict the list of returned objects by their labels. Defaults to everything.1192|limit|limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.1193 1194The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.1195|pretty|If 'true', then the output is pretty printed.1196|resourceVersion|When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.1197|timeoutSeconds|Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.1198|watch|Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.1199|===1200 