Managed Service for Apache Spark programmatic interfaces let you automate workloads and manage resources directly from your applications. Choosing the right interface helps you align with your programming language support, automation workflows, and client features like automated retries and operation polling.

Google Cloud provides several programmatic options---including Cloud Client Libraries, gRPC, and REST APIs---with Cloud Client Libraries recommended for most development environments.

## Available interfaces

You can use one of several programmatic interfaces when interacting with
Managed Service for Apache Spark. These are the available interfaces, in the order that
we recommend using them:

- [Google Cloud Client Libraries](https://docs.cloud.google.com/apis/docs/client-libraries-explained.md.txt#google_cloud_client_libraries):
  Managed Service for Apache Spark
  ([alpha and beta release](https://cloud.google.com/products#product-launch-stages))
  client libraries are available in multiple languages and
  are built on [gRPC](https://grpc.io/). These client
  libraries provide a layer of abstraction on top of
  gRPC and handle the details of operation polling, retries, and more.

  > [!NOTE]
  > **Note:** Although the Cloud Client Libraries are the preferred library choice, [Google API Client Libraries](https://developers.google.com/api-client-library/) for Managed Service for Apache Spark are also available. These "legacy" libraries access REST but not gRPC APIs (see [Google API Client Libraries](https://docs.cloud.google.com/apis/docs/client-libraries-explained.md.txt#google_api_client_libraries) for additional information).

- [gRPC](https://docs.cloud.google.com/managed-spark/docs/reference/rpc.md.txt): If a client library is not available
  for your programming language of choice, you can generate gRPC client
  libraries for Managed Service for Apache Spark in any gRPC-supported language. To do this, you'll need the
  [protocol buffers](https://developers.google.com/protocol-buffers/)
  service definition available from
  [our repository on GitHub](https://github.com/googleapis/googleapis).
  You can then follow the instructions for your preferred language on
  [grpc.io](https://grpc.io/) to generate and use your
  client.

- [REST API](https://docs.cloud.google.com/managed-spark/docs/reference/rest.md.txt): If you're unable
  to use Managed Service for Apache Spark's client libraries or the gRPC API, use the REST API.