pinecone_sdk/openapi/models/pod_spec.rs
1/*
2 * Pinecone Control Plane API
3 *
4 * Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
5 *
6 * The version of the OpenAPI document: 2024-07
7 * Contact: support@pinecone.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::openapi::models;
12use serde::{Deserialize, Serialize};
13
14/// PodSpec : Configuration needed to deploy a pod-based index.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PodSpec {
17 /// The environment where the index is hosted.
18 #[serde(rename = "environment")]
19 pub environment: String,
20 /// The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change.
21 #[serde(rename = "replicas")]
22 pub replicas: i32,
23 /// The number of shards. Shards split your data across multiple pods so you can fit more data into an index.
24 #[serde(rename = "shards")]
25 pub shards: i32,
26 /// The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.
27 #[serde(rename = "pod_type")]
28 pub pod_type: String,
29 /// The number of pods to be used in the index. This should be equal to `shards` x `replicas`.'
30 #[serde(rename = "pods")]
31 pub pods: i32,
32 #[serde(rename = "metadata_config", skip_serializing_if = "Option::is_none")]
33 pub metadata_config: Option<Box<models::PodSpecMetadataConfig>>,
34 /// The name of the collection to be used as the source for the index.
35 #[serde(rename = "source_collection", skip_serializing_if = "Option::is_none")]
36 pub source_collection: Option<String>,
37}
38
39impl PodSpec {
40 /// Configuration needed to deploy a pod-based index.
41 pub fn new(environment: String, replicas: i32, shards: i32, pod_type: String, pods: i32) -> PodSpec {
42 PodSpec {
43 environment,
44 replicas,
45 shards,
46 pod_type,
47 pods,
48 metadata_config: None,
49 source_collection: None,
50 }
51 }
52}
53