> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vessl.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Service

### list\_services

```python theme={null}
vessl.list_services(
   organization: str
)
```

Get a list of all services in an organization

**Args**

* `organization` (str) : The name of the organization.

**Example**

```python theme={null}
vessl.list_services(organization="my-org")
```

***

## read\_service

```python theme={null}
vessl.read_service(
   service_name: str
)
```

Get a service from a service name.

**Args**

* `service_name` (str) : The name of the service.

**Example**

```python theme={null}
vessl.read_service(service_name="my-service")
```

***

## create\_revision\_from\_yaml

```python theme={null}
vessl.create_revision_from_yaml(
   organization: str, yaml_body: str
)
```

Create a new revision of service from a YAML file.

**Args**

* `organization` (str) : The name of the organization.
* `yaml_body` (str) : The YAML body of the service.
  It is not deserialized YAML, but a whole yaml string.

**Example**

```python theme={null}
vessl.create_revision_from_yaml(
    organization="my-org",
    yaml_body=yaml_body)
```

***

## launch\_revision

```python theme={null}
vessl.launch_revision(
   organization: str, service_name: str, revision_number: int
)
```

Launch a service revision from a service name and revision number.

**Args**

* `organization` (str) : The name of the organization.
* `service_name` (str) : The name of the service.
* `revision_number` (int) : The revision number of the service.

**Example**

```python theme={null}
vessl.launch_revision(
    organization="my-org",
    service_name="my-service",
    revision_number=1)
```

***

## read\_revision

```python theme={null}
vessl.read_revision(
   organization: str, service_name: str, revision_number: int
)
```

Get a service revision from a service name and revision number.

**Args**

* `organization` (str) : The name of the organization.
* `service_name` (str) : The name of the service.
* `revision_number` (int) : The revision number of the service.

**Example**

```python theme={null}
vessl.read_revision(
    organization="my-org",
    service_name="my-service",
    revision_number=1)
```

***

## terminate\_revision

```python theme={null}
vessl.terminate_revision(
   organization: str, service_name: str, revision_number: int
)
```

Terminate a service revision from a service name and revision number.

**Args**

* `organization` (str) : The name of the organization.
* `service_name` (str) : The name of the service.
* `revision_number` (int) : The revision number of the service.

**Example**

```python theme={null}
vessl.terminate_revision(
    organization="my-org",
    service_name="my-service",
    revision_number=1)
```

***

## update\_revision\_autoscaler\_config

```python theme={null}
vessl.update_revision_autoscaler_config(
   organization: str, service_name: str, revision_number: int,
   autoscaling: V1Autoscaling
)
```

Update the autoscaler config of a service revision from a service name and revision number.

**Args**

* `organization` (str) : The name of the organization.
* `service_name` (str) : The name of the service.
* `revision_number` (int) : The revision number of the service.
* `autoscaling` (V1Autoscaling) : The autoscaler config of the service.

**Example**

```python theme={null}
vessl.update_revision_autoscaler_config(
    organization="my-org",
    service_name="my-service",
    revision_number=1,
    autoscaling=V1Autoscaling(
        min=1,
        max=2,
        metric="cpu",
        target=80,
    ))
```

***

## update\_revision\_autoscaling\_v2

```python theme={null}
vessl.update_revision_autoscaling_v2(
   organization: str, service_name: str, revision_number: int,
   autoscaling: V1Autoscaling
)
```

Update the autoscaler config of a service revision from a service name and revision number.

**Args**

* `organization` (str) : The name of the organization.
* `service_name` (str) : The name of the service.
* `revision_number` (int) : The revision number of the service.
* `autoscaling` (V1Autoscaling) : The autoscaler config of the service.

**Example**

```python theme={null}
vessl.update_revision_autoscaling_v2(
    organization="my-org",
    service_name="my-service",
    revision_number=1,
    autoscaling=V1Autoscaling(
        min=1,
        max=2,
        metric="cpu",
        target=80,
    ))
```

***

## list\_revisions

```python theme={null}
vessl.list_revisions(
   organization: str, service_name: str
)
```

Get a list of all revisions of a service.

**Args**

* `organization` (str) : The name of the organization.
* `service_name` (str) : The name of the service.

**Examples**

```python theme={null}
vessl.list_revisions(
    organization="my-org",
    service_name="my-service")
```

***

## read\_gateway

```python theme={null}
vessl.read_gateway(
   organization: str, service_name: str
)
```

Get the gateway of a service.

**Args**

* `organization` (str) : The name of the organization.
* `service_name` (str) : The name of the service.

**Examples**

```python theme={null}
vessl.read_gateway(
    organization="my-org",
    service_name="my-service")
```

***

## update\_gateway

```python theme={null}
vessl.update_gateway(
   organization: str, service_name: str,
   gateway: ModelServiceGatewayUpdateAPIInput
)
```

Update the gateway of a service.

**Args**

* `organization` (str) : The name of the organization.
* `service_name` (str) : The name of the service.
* `gateway` (ModelServiceGatewayUpdateAPIInput) : The gateway of the service.

**Examples**

```python theme={null}
from openapi_client import ModelServiceGatewayUpdateAPIInput
from openapi_client import OrmModelServiceGatewayTrafficSplitEntry

gateway = ModelServiceGatewayUpdateAPIInput(
    enabled=True,
    ingress_host="my-endpoint",
    traffic_split=[
        OrmModelServiceGatewayTrafficSplitEntry(
            revision_number=1,
            port=2222,
            traffic_weight=100,
        )
    ],
)

vessl.update_gateway(
    organization="my-org",
    service_name="my-service",
    gateway=gateway)
```

***

## update\_gateway\_for\_revision

```python theme={null}
vessl.update_gateway_for_revision(
   organization: str, service_name: str, revision_number: int, port: int,
   weight: int
)
```

Update the current gateway of a service for a specific revision.

**Args**

* `organization` (str) : The name of the organization.
* `service_name` (str) : The name of the service.
* `revision_number` (int) : The revision number of the service.
* `port` (int) : The port of the revision will use for gateway.
* `weight` (int) : The weight of the traffic will be distributed to revision\_number.

**Examples**

```python theme={null}
vessl.update_gateway_for_revision(
    organization="my-org",
    service_name="my-service",
    revision_number=1,
    port=2222,
    weight=100)
```

## (deprecated) update\_revision\_autoscaler\_config

```python theme={null}
vessl.update_revision_autoscaler_config(
   organization: str, serving_name: str, revision_number: int,
   auto_scaler_config: AutoScalerConfig
)
```

(THIS API IS DEPRECATED.)

Update the autoscaler config of a serving revision from a serving name and revision number.

**Args**

* `organization` (str) : The name of the organization.
* `serving_name` (str) : The name of the serving.
* `revision_number` (int) : The revision number of the serving.
* `auto_scaler_config` (AutoScalerConfig) : The autoscaler config of the serving.

**Example**

```python theme={null}
vessl.update_revision_autoscaler_config(
    organization="my-org",
    serving_name="my-serving",
    revision_number=1,
    auto_scaler_config=AutoScalerConfig(
        min_replicas=1,
        max_replicas=2,
        target_cpu_utilization_percentage=80,
    ))
```

***

## (deprecated) update\_gateway\_from\_yaml

```python theme={null}
vessl.update_gateway_from_yaml(
   organization: str, serving_name: str, yaml_body: str
)
```

(THIS API IS DEPRECATED.)

Update the gateway of a serving from a YAML file.

**Args**

* `organization` (str) : The name of the organization.
* `serving_name` (str) : The name of the serving.
* `yaml_body` (str) : The YAML body of the serving.
  It is not deserialized YAML, but a whole yaml string

**Examples**

```python theme={null}
vessl.update_gateway_from_yaml(
    organization="my-org",
    serving_name="my-serving",
    yaml_body=yaml_body)
```
