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

# NEO Metal (Pulumi)

> Resource dan function Pulumi buat server bare-metal NEO Metal

Server dedicated NEO Metal (`/baremetals` API group) plus add-onnya: additional (floating) IP dan NEO Elastic Storage.

<Info>
  Setiap create/upgrade bikin **order berbayar beneran**. Baca [panduan billing](/guides/billing) buat nilai `cycle` dan semantics `payWithCreditCard`.
</Info>

## `biznetgio:index:Baremetal`

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    import * as biznetgio from "@shirasakaren/biznetgio";

    const products = biznetgio.baremetalProductsOutput();

    const keypair = new biznetgio.BaremetalKeypair("metal-key", {
      name: "neo-metal-key",
    });

    const server = new biznetgio.Baremetal("metal-main", {
      productId: products.products[0].productId,
      cycle: "m",
      selectOs: "ubuntu-22",
      keypairId: keypair.keypairId,
      label: "neo-metal-main",
      publicIp: 1,
      // optional in-place actions (change value to fire):
      // powerState: "off",
      // resetTrigger: "reboot-1",
      // rebuildOs: "centos7-base",
    });

    export const serverStatus = server.status;
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import pulumi
    import pulumi_biznetgio

    products = pulumi_biznetgio.baremetal_products()

    keypair = pulumi_biznetgio.BaremetalKeypair(
        "metal-key",
        name="neo-metal-key",
    )

    server = pulumi_biznetgio.Baremetal(
        "metal-main",
        product_id=products.products[0].product_id,
        cycle="m",
        select_os="ubuntu-22",
        keypair_id=keypair.keypair_id,
        label="neo-metal-main",
        public_ip=1,
        # power_state="off",
        # reset_trigger="reboot-1",
        # rebuild_os="centos7-base",
    )

    pulumi.export("serverStatus", server.status)
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    package main

    import (
        biznetgio "github.com/shirasakaren/pulumi-biznetgio/sdk/go/pulumi-biznetgio"
        "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )

    func main() {
        pulumi.Run(func(ctx *pulumi.Context) error {
            products, err := biznetgio.BaremetalProducts(ctx, &biznetgio.BaremetalProductsArgs{})
            if err != nil {
                return err
            }

            keypair, err := biznetgio.NewBaremetalKeypair(ctx, "metal-key", &biznetgio.BaremetalKeypairArgs{
                Name: pulumi.String("neo-metal-key"),
            })
            if err != nil {
                return err
            }

            server, err := biznetgio.NewBaremetal(ctx, "metal-main", &biznetgio.BaremetalArgs{
                ProductId:  pulumi.Int(products.Products[0].ProductId),
                Cycle:      pulumi.String("m"),
                SelectOs:   pulumi.String("ubuntu-22"),
                KeypairId:  keypair.KeypairId,
                Label:      pulumi.String("neo-metal-main"),
                PublicIp:   pulumi.Int(1),
                // PowerState:   pulumi.String("off"),
                // ResetTrigger: pulumi.String("reboot-1"),
                // RebuildOs:    pulumi.String("centos7-base"),
            })
            if err != nil {
                return err
            }

            ctx.Export("serverStatus", server.Status)
            return nil
        })
    }
    ```
  </Tab>

  <Tab title=".NET">
    ```csharp theme={null}
    using System;
    using System.Collections.Generic;
    using Pulumi;
    using Shirasakaren.Biznetgio;

    return await Deployment.RunAsync(() =>
    {
        var products = BaremetalProducts.Invoke();

        var keypair = new BaremetalKeypair("metal-key", new BaremetalKeypairArgs
        {
            Name = "neo-metal-key",
        });

        var server = new Baremetal("metal-main", new BaremetalArgs
        {
            ProductId = products.Apply(p => p.Products[0].ProductId),
            Cycle = "m",
            SelectOs = "ubuntu-22",
            KeypairId = keypair.KeypairId,
            Label = "neo-metal-main",
            PublicIp = 1,
            // PowerState = "off",
            // ResetTrigger = "reboot-1",
            // RebuildOs = "centos7-base",
        });

        return new Dictionary<string, object?>
        {
            ["serverStatus"] = server.Status,
        };
    });
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    package demo;

    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import ren.shirasaka.biznetgio.*;

    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }

        private static void stack(Context ctx) {
            var products = BiznetgioFunctions.baremetalProducts();

            var keypair = new BaremetalKeypair("metal-key",
                BaremetalKeypairArgs.builder()
                    .name("neo-metal-key")
                    .build());

            var server = new Baremetal("metal-main",
                BaremetalArgs.builder()
                    .productId(products.applyValue(p -> p.products().get(0).productId()))
                    .cycle("m")
                    .selectOs("ubuntu-22")
                    .keypairId(keypair.keypairId())
                    .label("neo-metal-main")
                    .publicIp(1)
                    // .powerState("off")
                    // .resetTrigger("reboot-1")
                    // .rebuildOs("centos7-base")
                    .build());

            ctx.export("serverStatus", server.status());
        }
    }
    ```
  </Tab>

  <Tab title="YAML">
    ```yaml theme={null}
    resources:
      server:
        type: biznetgio:index:Baremetal
        properties:
          productId: ${products[0].productId}
          cycle: m
          selectOs: ubuntu-22
          keypairId: ${keypair.keypairId}
          label: neo-metal-main
          publicIp: 1
          # powerState: "off"
          # resetTrigger: reboot-1
          # rebuildOs: centos7-base
    ```
  </Tab>
</Tabs>

| Input               | Type   | Required | Notes                                                            |
| ------------------- | ------ | -------- | ---------------------------------------------------------------- |
| `productId`         | int64  | yes      | dari `baremetalProducts`                                         |
| `cycle`             | string | yes      | `m` bulanan / `a` tahunan                                        |
| `selectOs`          | string | no       | default `ubuntu-22`; create-only                                 |
| `keypairId`         | int64  | yes      | dari `BaremetalKeypair`; create-only                             |
| `label`             | string | yes      | nama tampilan - satu-satunya input yang bisa di-update           |
| `publicIp`          | int64  | no       | default `1`; create-only                                         |
| `promocode`         | string | no       | create-only                                                      |
| `payWithCreditCard` | bool   | no       | default `true`                                                   |
| `powerState`        | string | no       | `on` / `off`; API dipanggil cuma pas berubah                     |
| `resetTrigger`      | string | no       | one-shot reset; ganti value buat re-fire                         |
| `rebuildOs`         | string | no       | rebuild (destructive); value valid dari `baremetalRebuildOsList` |

Outputs: `status`, `orderId`, `ipAddress`, `createdAt`, `raw` (secret, di-redact). Import pake numeric account id.

## `biznetgio:index:BaremetalKeypair`

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const keypair = new biznetgio.BaremetalKeypair("metal-key", {
      name: "neo-metal-key",
      publicKey: "ssh-rsa AAAAB3NzaC1yc2E...",   // optional: import; omit to generate
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    keypair = pulumi_biznetgio.BaremetalKeypair(
        "metal-key",
        name="neo-metal-key",
        public_key="ssh-rsa AAAAB3NzaC1yc2E...",   # optional: import; omit to generate
    )
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    keypair, err := biznetgio.NewBaremetalKeypair(ctx, "metal-key", &biznetgio.BaremetalKeypairArgs{
        Name:      pulumi.String("neo-metal-key"),
        PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2E..."),
    })
    ```
  </Tab>

  <Tab title=".NET">
    ```csharp theme={null}
    var keypair = new BaremetalKeypair("metal-key", new BaremetalKeypairArgs
    {
        Name = "neo-metal-key",
        PublicKey = "ssh-rsa AAAAB3NzaC1yc2E...",
    });
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    var keypair = new BaremetalKeypair("metal-key",
        BaremetalKeypairArgs.builder()
            .name("neo-metal-key")
            .publicKey("ssh-rsa AAAAB3NzaC1yc2E...")
            .build());
    ```
  </Tab>

  <Tab title="YAML">
    ```yaml theme={null}
    keypair:
      type: biznetgio:index:BaremetalKeypair
      properties:
        name: neo-metal-key
        publicKey: "ssh-rsa AAAAB3NzaC1yc2E..."
    ```
  </Tab>
</Tabs>

| Input       | Type   | Required | Notes                                                              |
| ----------- | ------ | -------- | ------------------------------------------------------------------ |
| `name`      | string | yes      |                                                                    |
| `publicKey` | string | no       | di-set → di-import via endpoint import; kosong → digenerate server |

Outputs: `keypairId`, `privateKey` (secret - cuma ada di response create, dipertahankan saat refresh), `raw` (secret). Gak ada update.

## `biznetgio:index:BaremetalAdditionalIp`

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const ip = new biznetgio.BaremetalAdditionalIp("extra-ip", {
      productId: 10,
      cycle: "m",
      region: "wjv-1",
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    ip = pulumi_biznetgio.BaremetalAdditionalIp(
        "extra-ip",
        product_id=10,
        cycle="m",
        region="wjv-1",
    )
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    ip, err := biznetgio.NewBaremetalAdditionalIp(ctx, "extra-ip", &biznetgio.BaremetalAdditionalIpArgs{
        ProductId: pulumi.Int(10),
        Cycle:     pulumi.String("m"),
        Region:    pulumi.String("wjv-1"),
    })
    ```
  </Tab>

  <Tab title=".NET">
    ```csharp theme={null}
    var ip = new BaremetalAdditionalIp("extra-ip", new BaremetalAdditionalIpArgs
    {
        ProductId = 10,
        Cycle = "m",
        Region = "wjv-1",
    });
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    var ip = new BaremetalAdditionalIp("extra-ip",
        BaremetalAdditionalIpArgs.builder()
            .productId(10)
            .cycle("m")
            .region("wjv-1")
            .build());
    ```
  </Tab>

  <Tab title="YAML">
    ```yaml theme={null}
    ip:
      type: biznetgio:index:BaremetalAdditionalIp
      properties:
        productId: 10
        cycle: m
        region: wjv-1
    ```
  </Tab>
</Tabs>

| Input               | Type   | Required | Notes                                                         |
| ------------------- | ------ | -------- | ------------------------------------------------------------- |
| `productId`         | int64  | yes      | dari `GET /baremetal-additional-ips/products`                 |
| `cycle`             | string | yes      | `m` / `a`                                                     |
| `region`            | string | no       | default `wjv-1`; dari `GET /baremetal-additional-ips/regions` |
| `promocode`         | string | no       |                                                               |
| `payWithCreditCard` | bool   | no       | default `true`                                                |

Outputs: `status`, `ipAddress`, `createdAt`, `raw` (secret). Gak ada update - perubahan input ganti resourcenya.

## `biznetgio:index:BaremetalAdditionalIpAssignment`

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const assignment = new biznetgio.BaremetalAdditionalIpAssignment("assign", {
      additionalIpId: ip.id,
      metalAccountId: server.id,
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    assignment = pulumi_biznetgio.BaremetalAdditionalIpAssignment(
        "assign",
        additional_ip_id=ip.id,
        metal_account_id=server.id,
    )
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    assignment, err := biznetgio.NewBaremetalAdditionalIpAssignment(ctx, "assign", &biznetgio.BaremetalAdditionalIpAssignmentArgs{
        AdditionalIpId:  ip.ID(),
        MetalAccountId:  server.ID(),
    })
    ```
  </Tab>

  <Tab title=".NET">
    ```csharp theme={null}
    var assignment = new BaremetalAdditionalIpAssignment("assign", new BaremetalAdditionalIpAssignmentArgs
    {
        AdditionalIpId = ip.Id,
        MetalAccountId = server.Id,
    });
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    var assignment = new BaremetalAdditionalIpAssignment("assign",
        BaremetalAdditionalIpAssignmentArgs.builder()
            .additionalIpId(ip.id())
            .metalAccountId(server.id())
            .build());
    ```
  </Tab>

  <Tab title="YAML">
    ```yaml theme={null}
    assignment:
      type: biznetgio:index:BaremetalAdditionalIpAssignment
      properties:
        additionalIpId: ${ip.id}
        metalAccountId: ${server.id}
    ```
  </Tab>
</Tabs>

| Input            | Type  | Required | Notes                        |
| ---------------- | ----- | -------- | ---------------------------- |
| `additionalIpId` | int64 | yes      | dari `BaremetalAdditionalIp` |
| `metalAccountId` | int64 | yes      | server target                |

Outputs: `status`, `raw` (secret). Composite id `<metalAccountId>:<additionalIpId>`; reassign = replace.

## `biznetgio:index:BaremetalElasticStorage`

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const storage = new biznetgio.BaremetalElasticStorage("volume", {
      productId: 20,
      cycle: "m",
      storageName: "metal-volume",
      metalAccountId: server.id,
      size: 100,   // grow-only
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    storage = pulumi_biznetgio.BaremetalElasticStorage(
        "volume",
        product_id=20,
        cycle="m",
        storage_name="metal-volume",
        metal_account_id=server.id,
        size=100,   # grow-only
    )
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    storage, err := biznetgio.NewBaremetalElasticStorage(ctx, "volume", &biznetgio.BaremetalElasticStorageArgs{
        ProductId:       pulumi.Int(20),
        Cycle:           pulumi.String("m"),
        StorageName:     pulumi.String("metal-volume"),
        MetalAccountId:  server.ID(),
        Size:            pulumi.Int(100),
    })
    ```
  </Tab>

  <Tab title=".NET">
    ```csharp theme={null}
    var storage = new BaremetalElasticStorage("volume", new BaremetalElasticStorageArgs
    {
        ProductId = 20,
        Cycle = "m",
        StorageName = "metal-volume",
        MetalAccountId = server.Id,
        Size = 100,
    });
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    var storage = new BaremetalElasticStorage("volume",
        BaremetalElasticStorageArgs.builder()
            .productId(20)
            .cycle("m")
            .storageName("metal-volume")
            .metalAccountId(server.id())
            .size(100)
            .build());
    ```
  </Tab>

  <Tab title="YAML">
    ```yaml theme={null}
    storage:
      type: biznetgio:index:BaremetalElasticStorage
      properties:
        productId: 20
        cycle: m
        storageName: metal-volume
        metalAccountId: ${server.id}
        size: 100
    ```
  </Tab>
</Tabs>

| Input               | Type   | Required | Notes                                    |
| ------------------- | ------ | -------- | ---------------------------------------- |
| `productId`         | int64  | yes      | ganti = trigger change-package           |
| `cycle`             | string | yes      | `m` / `a`                                |
| `storageName`       | string | yes      |                                          |
| `metalAccountId`    | int64  | yes      | create-only - gak ada endpoint re-attach |
| `size`              | int64  | no       | default `100` GB, cuma bisa naik         |
| `promocode`         | string | no       |                                          |
| `payWithCreditCard` | bool   | no       | default `true`                           |

Outputs: `status`, `createdAt`, `raw` (secret). Update: `size` → upgrade, `productId` → change-package.

## Functions

### `biznetgio:index:baremetalProducts`

Gak ada argument. Return `products`: `productId`, `name`, `description`, `raw` (secret).

### `biznetgio:index:baremetalRebuildOsList`

Argument `accountId` (int64). Return `oss` (string\[]) dan `raw` (secret) - value valid buat `rebuildOs`.

### `biznetgio:index:baremetalOpenvpn`

Gak ada argument. Return `config` (secret) dan `raw` (secret) - konfigurasi akses OpenVPN out-of-band.
